Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

In VBA how to load Outlook email in front of Access 1

Status
Not open for further replies.

08211987

Programmer
Apr 20, 2012
187
US
Hi,
I am generating a email in VBA and having it display so that the user can populate the To: name. What code do I use to force the email to display on top of access so that it is displayed to the user and not hidden behind. Here is my code that displays the email:
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
Next
' Should we display the message before sending?
If DisplayMsg Then
.Display
Else
.Save
.Display 'to display email only
'.Send
End If
End With
Thanks!
 
I'd try the AppActivate instruction.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I modified the code to look like this and received an error "Invalid procedure call or argument":
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
Next
' Should we display the message before sending?
If DisplayMsg Then
.Display
Else
.Save
.Display 'to display email only
AppActivate "Microsoft Outlook"
'.Send
End If
End With

Is my syntax correct or is something else needed?
Thanks!
 
What is the value of the tittle bar of the displayed message ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Excellent, thanks so much for that question! The subject line is what is actually displayed in the title bar so I coded this and it resolved the issue:

Else
.Save
.Display 'to display email only
AppActivate "A PSSA Request has been updated"
------
The subject line starts out with that wording and continues with some other variable that define the project name & number but by placing the beginning text of the subject it worked perfectly!
Thanks PH!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top