F
Fred Zuckerman
I have the following code behind a command button.
How can I get the Outlook application to become the active/visible window so
the user can use their addressbook to select recipients?
Private Sub CommandButton1_Click()
If MsgBox("Ready To Send Email?", vbYesNo) = vbYes Then
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
Set oOutlookApp = CreateObject("Outlook.Application")
Set oItem = oOutlookApp.CreateItem(olMailItem)
oItem.Subject = "GST Recap For " & Me.TextBox1
oItem.Body = "Team = " & Me.ComboBox1 & vbCrLf & _
"Ofcr = " & Me.TextBox3 & vbCrLf & _
Me.TextBox4
oItem.Send
Set oItem = Nothing
Set oOutlookApp = Nothing
End If
End Sub
I tried inserting the following line, but it doesn't work:
oOutlookApp.Application.Visible
Thanks In Advance,
Fred Zuckerman
How can I get the Outlook application to become the active/visible window so
the user can use their addressbook to select recipients?
Private Sub CommandButton1_Click()
If MsgBox("Ready To Send Email?", vbYesNo) = vbYes Then
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
Set oOutlookApp = CreateObject("Outlook.Application")
Set oItem = oOutlookApp.CreateItem(olMailItem)
oItem.Subject = "GST Recap For " & Me.TextBox1
oItem.Body = "Team = " & Me.ComboBox1 & vbCrLf & _
"Ofcr = " & Me.TextBox3 & vbCrLf & _
Me.TextBox4
oItem.Send
Set oItem = Nothing
Set oOutlookApp = Nothing
End If
End Sub
I tried inserting the following line, but it doesn't work:
oOutlookApp.Application.Visible
Thanks In Advance,
Fred Zuckerman