Shell Fiunction Not Working Properly

JamesJoey

Registered User.
Local time
Today, 05:21
Joined
Dec 6, 2010
Messages
642
The following codem works except fo the fact that the Windows Live Mail window opens behind Access.

Code:
Public Function RunLiveMail()
    
    Dim MyPath As String
    MyPath = "C:\Program Files (x86)\Windows Live\Mail\wlmail.exe /mail ,3"
    Shell MyPath
    
End Function

I thought the "3" switch is to open it maximized and having the focus??
It sure doesn't seem to have the focus.

What am I missing??

James
 
You're passing the 3 as a parameter to WlMail. The correct way would be to leave the 3 out of the MyPath variable and call it like:
Code:
Shell MyPath[COLOR="Red"], vbMaximizedFocus[/COLOR]

The access constant vbMaximizedFocus = 3, I prefer using the constants as it makes it easier to read the code.
 
Makes sense.
Works fine now.

Thanks much,
James
 

Users who are viewing this thread

Back
Top Bottom