PDA

View Full Version : Minimize Outlook window from Excel



simora
09-12-2008, 07:41 PM
I am using Outlook to send an Excel attachment using VBA. The VBA code is in the Excel sheet. The email is sent using SendKeys to click the send button in Outlook. How can I minimize the Outlook window while waiting for sendkeys.
I dont want the user to actually see an Outlook window. Here's the end of my code that takes care of sendkeys etc..etc..



.Subject = " Sent " & " " & " " & Format(Now, "mm-dd-yyyy hh-mm ")
.Body = "No Display attempt Info..."
.Attachments.Add TotalsWb.FullName

OL.Visible = True
.Display
.WindowState = olMinimized
End With

Set mpMail = Nothing

Application.Wait Now() + TimeSerial(0, 0, 7)

SendKeys "%{s}", True
End Function




I have tried .WindowState = olMinimized

and a few other formats like Application.WindowState = wdWindowStateMinimize

Any help, ideas ? Suggestions

Thanks

shamsam1
09-12-2008, 08:31 PM
http://www.techsupportforum.com/microsoft-support/microsoft-office-support/43048-can-t-minimize-outlook-2003-startup-tried-everything.html

check this 1

simora
09-12-2008, 08:57 PM
Hi:

I only want to Minimize Outlook when I am sending this specific email from excel. What they're doing is starting Outlook in Minimizzed mode. That'll be a no go for me.

Thanks for the link anyway. I may use some of that info later.

Any other ideas