A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

macro to forward



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 22nd 06, 11:42 PM posted to microsoft.public.outlook.program_vba
Dan
external usenet poster
 
Posts: 166
Default macro to forward

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  
Old February 23rd 06, 01:18 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default macro to forward

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  
Old February 23rd 06, 02:59 PM posted to microsoft.public.outlook.program_vba
Dan
external usenet poster
 
Posts: 166
Default macro to forward

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  
Old February 23rd 06, 03:20 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default macro to forward

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  
Old February 23rd 06, 06:28 PM posted to microsoft.public.outlook.program_vba
Dan
external usenet poster
 
Posts: 166
Default macro to forward

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  
Old February 23rd 06, 06:32 PM posted to microsoft.public.outlook.program_vba
Dan
external usenet poster
 
Posts: 166
Default macro to forward

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  
Old February 23rd 06, 06:46 PM posted to microsoft.public.outlook.program_vba
Dan
external usenet poster
 
Posts: 166
Default macro to forward

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  
Old February 23rd 06, 07:20 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default macro to forward

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  
Old February 23rd 06, 07:22 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default macro to forward

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 06:34 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.