Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim MsgText As String
Dim MeetingType As String
'Create the Outlook session
'Set objOutlook = New Outlook.Application
Set objOutlook = GetObject(, "Outlook.Application")
If Err.Number <> 0 Then
Set objOutlook = CreateObject("Outlook.Application")
End If
'Create message
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
MeetingType = Forms!MeetingForm!MeetingType
With objOutlookMsg
Select Case MeetingType
Case "IHP"
.Subject = "IHP Meeting Attendees Verified"
Case "IDT"
.Subject = "IDT Meeting Attendees Verified"
End Select
End With
objOutlook.ActiveWindow
'Cleanup
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
Set objOutlookRecip = Nothing
When I run this code, nothing happens. What am I doing wrong? Also, how do
I wait to perform cleanup (set all objects to Nothing), till the user sends
the email? Thanks so much.
Debbie
Set objOutlook = CreateObject("Outlook.Application")
Set newMail = objOutlook.CreateItem(olMailItem)
newMail.display
But if you want the window to show...
Set myNameSpace = objOutlook.GetNameSpace("MAPI")
Set myFolder= myNameSpace.GetDefaultFolder(olFolderInbox)
myFolder.Display
Until you excute the .Display method of the object, the object exists
only in memory. (Like Rose in Titanic - He exists now only in my memory.)
David H