Welcome to Lockergnome.com!
HomeHome FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

Auto-Forward Macro

 
   Home -> Office -> Programming VBA RSS
Next:  Programming VBA: Automating a macro  
Author Message
DavidW




Joined: Jul 16, 2008
Posts: 2



(Msg. 1) Posted: Wed Jul 16, 2008 12:12 pm
Post subject: Auto-Forward Macro

I am trying to design a macro for Outlook 2007 that will enable me to click on an item, then run the macro and either create a new mail item with the attachement from the original message or bring up a forward message, and replace the body text with a pre-set paragraph of text. I've seen some other threads showing how to write the text in as html, but I can't figure out the references to get the item to forward.

My previous experience with VBA is limited to Excel.
Back to top
Login to vote
DavidW




Joined: Jul 16, 2008
Posts: 2



(Msg. 2) Posted: Wed Jul 16, 2008 12:53 pm
Post subject:

I have been able to come up with the following. This will forward an e-mail which is already open, but I'm trying to learn to forward the e-mail from within the main outlook window.


Dim objMail As Outlook.MailItem, objNewMail As Outlook.MailItem
Set objMail = Application.ActiveInspector.CurrentItem
Set objNewMail = objMail.Forward
objNewMail.Display
objNewMail.Subject = Right(objNewMail.Subject, Len(objNewMail.Subject) - 4) 'To remove FW:
objNewMail.HTMLBody = "<html><body>Good Day!<br>SignitureMessage</body></html>"
objNewMail.CC = "none@none.com"
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> Programming VBA All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 General
 Microsoft Windows XP
 Microsoft Windows Vista
 Microsoft Windows (other)
  Microsoft Office
 Microsoft Office (other)
 Computer Security
 Linux
 Movies


[ Contact us | Terms of Service/Privacy Policy ]