![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Does anyone know how I can add a subject to this macro?
Sub ForwardMe() On Error Resume Next Set thisItem = Application.ActiveInspector.CurrentItem Set fwdItem = thisItem.Forward fwdItem.To = " fwdItem.Send End Sub In other words how can I write the macro to include a message like (Forwarded from DC) on the subject line? Thannks |
Ads |
#2
|
|||
|
|||
![]()
fwdItem.Subject = "Forwarded from DC"
When in doubt, check the object browser: Press ALt+F11 to open the VBA environment in Outlook, then press F2. Switch from All Libraries to Outlook to browse all Outlook objects and their properties, methods, and events. Select any object or member, then press F1 to see its Help topic. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Dan" wrote in message ... Does anyone know how I can add a subject to this macro? Sub ForwardMe() On Error Resume Next Set thisItem = Application.ActiveInspector.CurrentItem Set fwdItem = thisItem.Forward fwdItem.To = " fwdItem.Send End Sub In other words how can I write the macro to include a message like (Forwarded from DC) on the subject line? Thannks |
#3
|
|||
|
|||
![]()
Sue:
This is very helpful. Thank you. I have one additional issue. When I try to set up a second macro to forward to an additional person, it screws up my original macro. I really the solution may be very simple. Unfortunately, I have not been able to set up a second macro to send to a different person. Any help would be GREATLY appreciated. "Dan" wrote: Does anyone know how I can add a subject to this macro? Sub ForwardMe() On Error Resume Next Set thisItem = Application.ActiveInspector.CurrentItem Set fwdItem = thisItem.Forward fwdItem.To = " fwdItem.Send End Sub In other words how can I write the macro to include a message like (Forwarded from DC) on the subject line? Thannks |
#4
|
|||
|
|||
![]()
Screws it up how? Did you remember to give the second macro a different name?
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Dan" wrote in message ... Sue: This is very helpful. Thank you. I have one additional issue. When I try to set up a second macro to forward to an additional person, it screws up my original macro. I really the solution may be very simple. Unfortunately, I have not been able to set up a second macro to send to a different person. Any help would be GREATLY appreciated. "Dan" wrote: Does anyone know how I can add a subject to this macro? Sub ForwardMe() On Error Resume Next Set thisItem = Application.ActiveInspector.CurrentItem Set fwdItem = thisItem.Forward fwdItem.To = " fwdItem.Send End Sub In other words how can I write the macro to include a message like (Forwarded from DC) on the subject line? Thannks |
#5
|
|||
|
|||
![]()
Maybe I am exposing my ignorance but I simply repeat the process (with a
different email address) right below (there is a line for a break) the first macro. This is where the curnsor takes me after I type in a new macro name. Am I doing something wrong to create a new macro? "Sue Mosher [MVP-Outlook]" wrote: Screws it up how? Did you remember to give the second macro a different name? -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Dan" wrote in message ... Sue: This is very helpful. Thank you. I have one additional issue. When I try to set up a second macro to forward to an additional person, it screws up my original macro. I really the solution may be very simple. Unfortunately, I have not been able to set up a second macro to send to a different person. Any help would be GREATLY appreciated. "Dan" wrote: Does anyone know how I can add a subject to this macro? Sub ForwardMe() On Error Resume Next Set thisItem = Application.ActiveInspector.CurrentItem Set fwdItem = thisItem.Forward fwdItem.To = " fwdItem.Send End Sub In other words how can I write the macro to include a message like (Forwarded from DC) on the subject line? Thannks |
#6
|
|||
|
|||
![]()
Also, if I wanted to make a new macro named "Mo" would the first line read
"Sub(Mo)"? "Sue Mosher [MVP-Outlook]" wrote: Screws it up how? Did you remember to give the second macro a different name? -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Dan" wrote in message ... Sue: This is very helpful. Thank you. I have one additional issue. When I try to set up a second macro to forward to an additional person, it screws up my original macro. I really the solution may be very simple. Unfortunately, I have not been able to set up a second macro to send to a different person. Any help would be GREATLY appreciated. "Dan" wrote: Does anyone know how I can add a subject to this macro? Sub ForwardMe() On Error Resume Next Set thisItem = Application.ActiveInspector.CurrentItem Set fwdItem = thisItem.Forward fwdItem.To = " fwdItem.Send End Sub In other words how can I write the macro to include a message like (Forwarded from DC) on the subject line? Thannks |
#7
|
|||
|
|||
![]()
Should I be doing something other than
typing Tools/Macros/Create/Enter New Macros Name/Copy Instructions from prior macros with new email address for the forward/save/return to outlook "Sue Mosher [MVP-Outlook]" wrote: Screws it up how? Did you remember to give the second macro a different name? -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Dan" wrote in message ... Sue: This is very helpful. Thank you. I have one additional issue. When I try to set up a second macro to forward to an additional person, it screws up my original macro. I really the solution may be very simple. Unfortunately, I have not been able to set up a second macro to send to a different person. Any help would be GREATLY appreciated. "Dan" wrote: Does anyone know how I can add a subject to this macro? Sub ForwardMe() On Error Resume Next Set thisItem = Application.ActiveInspector.CurrentItem Set fwdItem = thisItem.Forward fwdItem.To = " fwdItem.Send End Sub In other words how can I write the macro to include a message like (Forwarded from DC) on the subject line? Thannks |
#8
|
|||
|
|||
![]()
Sub tells VBA that it's a subroutine, not a Function. The name is the second "word" in the procedure. Each procedure in a module needs a unique name, so if you want to name it Mo, it would be:
Sub Mo() The parentheses at the end can be empty or can hold the names of parameters -- data that your procedure will use in its code. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Dan" wrote in message ... Also, if I wanted to make a new macro named "Mo" would the first line read "Sub(Mo)"? "Sue Mosher [MVP-Outlook]" wrote: Screws it up how? Did you remember to give the second macro a different name? "Dan" wrote in message ... Sue: This is very helpful. Thank you. I have one additional issue. When I try to set up a second macro to forward to an additional person, it screws up my original macro. I really the solution may be very simple. Unfortunately, I have not been able to set up a second macro to send to a different person. Any help would be GREATLY appreciated. "Dan" wrote: Does anyone know how I can add a subject to this macro? Sub ForwardMe() On Error Resume Next Set thisItem = Application.ActiveInspector.CurrentItem Set fwdItem = thisItem.Forward fwdItem.To = " fwdItem.Send End Sub In other words how can I write the macro to include a message like (Forwarded from DC) on the subject line? Thannks |
#9
|
|||
|
|||
![]()
That sounds like Word, not Outlook. Outlook doesn't have a Create command in the Macros dialog.
The easiest way to create a macro is simply to open the Outlook VBA environment with Alt+F11 and start typing in the built-in ThisOutlookSession module. If you're new to Outlook VBA macros, these web pages should help you get started: http://www.winnetmag.com/Articles/In...eID=21522&pg=1 http://www.outlookcode.com/d/vb.htm -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Dan" wrote in message ... Should I be doing something other than typing Tools/Macros/Create/Enter New Macros Name/Copy Instructions from prior macros with new email address for the forward/save/return to outlook "Sue Mosher [MVP-Outlook]" wrote: Screws it up how? Did you remember to give the second macro a different name? -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Dan" wrote in message ... Sue: This is very helpful. Thank you. I have one additional issue. When I try to set up a second macro to forward to an additional person, it screws up my original macro. I really the solution may be very simple. Unfortunately, I have not been able to set up a second macro to send to a different person. Any help would be GREATLY appreciated. "Dan" wrote: Does anyone know how I can add a subject to this macro? Sub ForwardMe() On Error Resume Next Set thisItem = Application.ActiveInspector.CurrentItem Set fwdItem = thisItem.Forward fwdItem.To = " fwdItem.Send End Sub In other words how can I write the macro to include a message like (Forwarded from DC) on the subject line? Thannks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Running Macro | Sanjeev kumar Kodavalla | Outlook - Using Forms | 2 | March 5th 06 07:24 PM |
Macro Creation | Jim Patterson | Outlook and VBA | 1 | February 1st 06 05:23 PM |
outlook macro | matt | Outlook and VBA | 1 | January 30th 06 01:30 PM |
Distributing a Macro | sweens319 | Outlook and VBA | 2 | January 10th 06 06:48 PM |
VB and outlook macro need help | jbullington | Outlook and VBA | 1 | January 10th 06 03:22 PM |