VBA -Launch Word from Outlook - beginners question
Posted on 2004-04-26
I am trying to teach myself how to program in Outlook from a book. I am now playing with VBA. The book is written for Outlook 2002, but I am using 2003. Here is the simple code they have me write:
Public Sub LaunchWordMail()
On Error Resume Next
Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Set wdApp = CreateObject("Word.Application")
Set wdDoc = _
wdApp.Visible = True
wdApp.ActiveWindow.EnvelopeVisible = True
This is supposed to launch a new email message, using Word as the editor. It works on my 2002 machine but when I try it on my 2003 machine I get the following error:
Can't find project or library.
It then highlights "wdNewEmailMessge". I have verified that the Microsoft Word 11.0 Object Library is selected in my references, and when I look through the help files it looks like I should be able to use wdNewEmailMessage.
Any thoguhts? (and remember, I have no idea what i'm doing : )