Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / September 2005

Tip: Looking for answers? Try searching our database.

Simple way to autoforward

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nyresource@hotmail.com - 26 Sep 2005 21:04 GMT
I am trying to write a script that forwards the current message. From
the examples I see in Microsoft here is what I came up with:

Sub Autoforward()

Dim myinspector As Outlook.Inspector

Dim oNewEmailMessage As Outlook.MailItem

Set oNewEmailMessage = myinspector.CurrentItem.Forward

oNewEmailMessage.Display

oNewEmailMessage.Recipients.Add "anyname@anymail.com"

oNewEmailMessage.Send

End Sub

I get a message that says "Object variable or With block variable not
set"

Any ideas on where I can turn for help?
Thanks
Michael Bauer - 27 Sep 2005 20:14 GMT
Am 26 Sep 2005 13:04:07 -0700 schrieb nyresource@hotmail.com:

You need to set myInspector to an Inspector object, e.g. to the
Application.ActiveInspector.

Signature

Viele Gruesse / Best regards
Michael Bauer - MVP Outlook

> I am trying to write a script that forwards the current message. From
> the examples I see in Microsoft here is what I came up with:
[quoted text clipped - 20 lines]
> Any ideas on where I can turn for help?
> Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.