PDA

View Full Version : Solved: open program from acess won't min. program



Trevor
01-24-2008, 04:38 PM
I am trying to open outlook from access and minimize outlook after open,
My code forsome reason minmizes access and opens outlook. here is my code, I am using Sendkeys to min OL ( "%" = alt, " " = spacebar, "n" = leter n)
If I place the send keys on the same line as the outlook path or the call sell , I get an error from the compiler "expected end of statement", even when using &

stAppName = "C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE"

SendKeys "%" & " " & "n"
Call Shell(stAppName, 1)
End Sub

thanks for any help.
Trevor

akn112
01-25-2008, 09:06 AM
you have to send the keys after the app is opened. Or else you'll just be minimizing whatever has the focus at the time. move the sendkeys after the call.

Trevor
01-25-2008, 04:40 PM
I tried that and it does not minimze OL or Min any thing, reviesed code:

stAppName = "C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE"


Call Shell(stAppName, 1)

SendKeys Altkey & spacebar & "(n)

Trevor
01-27-2008, 06:15 PM
stAppName = "C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE"
Call Shell(stAppName, 1)
SendKeys "%{ }n"