Why won't this work???

  • Thread starter Thread starter gm
  • Start date Start date
G

gm

What is wrong with this code. It will not work. Do I need
to make sure that I have certain reference libs loaded?

Sub testdatebox()
Documents.Add Template:="Normal", NewTemplate:=False,
DocumentType:=2


With objmailitem
objmailitem.To = "tomail"
objmailitem.Subject = "Confrence Room Request Please"
objmailitem.Body = "line2"
End With

End Sub
 
What doesn't work? What are you trying to do? Where is this code running?
How are you instantiating objMailItem?
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



What is wrong with this code. It will not work. Do I need
to make sure that I have certain reference libs loaded?

Sub testdatebox()
Documents.Add Template:="Normal", NewTemplate:=False,
DocumentType:=2


With objmailitem
objmailitem.To = "tomail"
objmailitem.Subject = "Confrence Room Request Please"
objmailitem.Body = "line2"
End With

End Sub
 
What I want to do is have a macro that will create a new
mail message and then populate the the to field subject
and body. It seems that the correct library is loaded but
I must not know enough to do it myself.

Thanks
 
You need to create the message first with the Application.CreateItem method
before you can set its properties. If you're new to Outlook VBA macros,
these web pages should help you get more of these basics:

http://www.winnetmag.com/Articles/Index.cfm?ArticleID=21522&pg=1
http://www.outlookcode.com/d/vb.htm

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



What I want to do is have a macro that will create a new
mail message and then populate the the to field subject
and body. It seems that the correct library is loaded but
I must not know enough to do it myself.

Thanks
 
Back
Top