Help with this code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have been trying most of the day to get this to work. Sue turned me in one direction wich was helpful but I am still having problems. This code runs but never populates the to subject and body fields, but I get no errors. Help please would be great. I think that I have posted more detail then what I have in the past
Sub testdatebox(
Dim objnewmsg As Objec
Set objnewmsg = Application.CreateItem(olMailItem

With objnewms
Documents.Add Template:="Normal", NewTemplate:=False, DocumentType:=
Visible = Tru
.To = "(e-mail address removed)
.Subject = "Confrence Room Request Please
.Body = "line2
End Wit

End Su

Thank
GM I really need this to work......pleas
 
Unless you add a statement to save or display the message, how would you
know whether the code is populating those fields?
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



I have been trying most of the day to get this to work. Sue turned me in one
direction wich was helpful but I am still having problems. This code runs
but never populates the to subject and body fields, but I get no errors.
Help please would be great. I think that I have posted more detail then what
I have in the past.
Sub testdatebox()
Dim objnewmsg As Object
Set objnewmsg = Application.CreateItem(olMailItem)

With objnewmsg
Documents.Add Template:="Normal", NewTemplate:=False, DocumentType:=2
Visible = True
.To = "(e-mail address removed)"
.Subject = "Confrence Room Request Please"
.Body = "line2"
End With

End Sub


Thanks
GM I really need this to work......please
 
Try:

Dim myOlApp As Outlook.Application
Dim objnewmsg As Object

Set myOlApp = CreateObject("Outlook.Application")
Set objnewmsg = myOlApp.CreateItem(olMailItem)

With ....

Works for me (no credit to me for the code, though!)

Rob
 
Back
Top