When I create Outlook mail in Excel VBA, the mail screen may not be active after execution. How do I activate it?
The code looks like the following
DimobjOutlookAsOutlook.Application
DimobjMailAsOutlook.MailItem
SetobjOutlook=CreateObject("Outlook.Application")
SetobjMail=objOutlook.CreateItem(olMailItem)
With objMail
.To="[email protected]"
.Subject="Regarding 〇 の 〇"
.BodyFormat=olFormatPlain
.Body="Email Body"
.Display
End With
I got here because I wanted to do the same thing.
.Display
and
End With
during
.GetInspector.Activate
If you put in one line, it's done.
I also found that the above corrections do not come forward.
Therefore, I am trying to rewrite it as follows.
before modification:
.GetInspector.Activate
modified:
.GetInspector.Display(False)
© 2024 OneMinuteCode. All rights reserved.