PC Review


Reply
Thread Tools Rate Thread

Can I use a macro within Outlook ?

 
 
Roger
Guest
Posts: n/a
 
      4th Dec 2009
I am using Outlook 2003. I have written vba for macros in other office apps
but not Outlook. We get a lot of emails with sales details. Many are
forwarded to another email address outside the company once they have been
checked. Because they have to be checked and decision made re forwarding or
not, I cannot use the autoforward as part of a rule.

I want a simple macro to forward a message I highlight in the inbox to a
nominated email address, using the message's subject line as the subject
line in the forwarding email (ie using the default subject). Is this
possible from within Outlook ?

thanks

Roger


 
Reply With Quote
 
 
 
 
Sue Mosher [MVP]
Guest
Posts: n/a
 
      4th Dec 2009
Yes, Outlook has a VBA environment, accessed just like that in other
applications with Alt+F11 or Tools | Macros | VBA. These pages can help you
get started:

http://www.outlookcode.com/article.aspx?id=49
http://www.outlookcode.com/article.aspx?ID=40

The item selected in the current window is returned by
Application.ActiveExplorer.Selection(1), so your macro would be something
like this:

Sub MyMacro()
Dim msg As Outlook.MailItem
Set itm = Application.ActiveExplorer.Selection(1)
Set msg = itm.Forward
msg.To = "(E-Mail Removed)"
msg.Send
Set msg = Nothing
Set itm = Nothing
End Sub
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Roger" <help-(E-Mail Removed)> wrote in message
news:%23yw%(E-Mail Removed)...
>I am using Outlook 2003. I have written vba for macros in other office apps
> but not Outlook. We get a lot of emails with sales details. Many are
> forwarded to another email address outside the company once they have been
> checked. Because they have to be checked and decision made re forwarding
> or
> not, I cannot use the autoforward as part of a rule.
>
> I want a simple macro to forward a message I highlight in the inbox to a
> nominated email address, using the message's subject line as the subject
> line in the forwarding email (ie using the default subject). Is this
> possible from within Outlook ?
>
> thanks
>
> Roger
>
>



 
Reply With Quote
 
Roger
Guest
Posts: n/a
 
      4th Dec 2009
Great, thanks

Roger

"Sue Mosher [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Yes, Outlook has a VBA environment, accessed just like that in other
> applications with Alt+F11 or Tools | Macros | VBA. These pages can help
> you get started:
>
> http://www.outlookcode.com/article.aspx?id=49
> http://www.outlookcode.com/article.aspx?ID=40
>
> The item selected in the current window is returned by
> Application.ActiveExplorer.Selection(1), so your macro would be something
> like this:
>
> Sub MyMacro()
> Dim msg As Outlook.MailItem
> Set itm = Application.ActiveExplorer.Selection(1)
> Set msg = itm.Forward
> msg.To = "(E-Mail Removed)"
> msg.Send
> Set msg = Nothing
> Set itm = Nothing
> End Sub
> --
> Sue Mosher, Outlook MVP
> Author of Microsoft Outlook 2007 Programming:
> Jumpstart for Power Users and Administrators
> http://www.outlookcode.com/article.aspx?id=54
>
>
> "Roger" <help-(E-Mail Removed)> wrote in message
> news:%23yw%(E-Mail Removed)...
>>I am using Outlook 2003. I have written vba for macros in other office
>>apps
>> but not Outlook. We get a lot of emails with sales details. Many are
>> forwarded to another email address outside the company once they have
>> been
>> checked. Because they have to be checked and decision made re forwarding
>> or
>> not, I cannot use the autoforward as part of a rule.
>>
>> I want a simple macro to forward a message I highlight in the inbox to a
>> nominated email address, using the message's subject line as the subject
>> line in the forwarding email (ie using the default subject). Is this
>> possible from within Outlook ?
>>
>> thanks
>>
>> Roger
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Avoid Outlook macro security for Excel bades macro blackbox via OfficeKB.com Microsoft Excel Programming 4 15th Jun 2007 08:51 AM
Call macro stored in Excel workbook from Outlook's macro =?Utf-8?B?R3ZhcmFt?= Microsoft Excel Programming 0 4th Oct 2006 05:47 PM
Call macro stored in Excel workbook from Outlook's macro =?Utf-8?B?R3ZhcmFt?= Microsoft Outlook VBA Programming 5 4th Oct 2006 06:26 AM
Passing variables from Outlook Macro to Excel Macro brotherescott@yahoo.com Microsoft Excel Programming 2 7th Jan 2005 10:07 PM
Passing variables from Outlook Macro to Word Macro brotherescott@yahoo.com Microsoft Outlook VBA Programming 0 16th Dec 2004 03:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:43 PM.