make outlook visible

  • Thread starter Thread starter gopher
  • Start date Start date
G

gopher

After using a bit of code that send an email to outlook I get the email
warning message. Sometimes that message remains in the backround.

How do I bring the allready open outlook program to the foreground on
my desktop in VBA code?
 
olApp.Visible = True

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
it's still not working,...

Dim ol As Object, myItem As Object
Set ol = CreateObject("outlook.application")
Set myItem = ol.CreateItem(olMailItem)
myItem.To = Range("E2").Value
myItem.Subject = "A NEW PURCHASE ORDER HAS BEEN CREATED"
myItem.Body = "file:" & F & Chr(13) & Chr(13)
myItem.Body = myItem.Body & "This message was automatically
sent By Master PO 3.0"
myItem.Display
olApp.Visible = True ' i get an error here.
 
That is because you called it ol, so you would use

ol.Visible = True

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Right newsgroup, he is doing it from Excel via automation.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top