0 votes
in VBA by Beginner (2 points)
Hi,

The outlook instance (new email object) works fine. I use the myMail.Display to view the email before sending it.

The problem is that the very 1st time I use this from within Access 2016 the email sits flashing in the taskbar waiting to be selected. Every other time after the 1st time the email window is brought to the front ready for viewing.. no intervention required.

I use your code Ryan for bringing a Word doc to the front for viewing (thank you muchly,, scoured the internet for days looking for that solution) but that's not going to work in this instance for a couple of obvious reasons.

For starters how do you reference the most recently made object of an email in a shell environment and how do you bring it to the front. I have tried olMaximised in various ways to try and set focus on this new email. Same with .Display(True).

It's like Access does not know or recognise that Outllook is open and ready for work. After you send that 1st email it registers that Outlook is alive and waiting.

Anyway, even though it only happens on the first time it's damn annoying.

Thanks in advance for your assistance.

Please log in or register to answer this question.

Welcome to wellsr Q&A
wellsr Q&A is the VBA and Python programming community that rewards you for learning how to code.

Getting Started
Register
VBA Cheat Sheets (On Sale Now)

Earn free prizes for asking VBA and Python questions and for answering questions asked by others in our community.

What makes us different?
Our points system rewards you with a chance for free gifts based on the quality of your questions and answers. All you have to do is post and you could get rewarded, like these members:

coolag $10 Amazon Gift Card
Siew Hun $10 Amazon Gift Card

So, why don't you join us? It really is an encouraging way to motivate members in our VBA and Python community.

Register

For more programming tips visit the VBA Tutorials Blog and the Python Tutorials Blog.

...