Send Keys

S

sw

I am trying to update my send keys code to work with
Outlook 2002 Version 10.2627.2625 but it doesn't seem to
be working. The code is as follows:

Sub CheckOlVersion
Set ol = CreateObject("Outlook.Application")
iBuild = Int(Right(ol.Version, 4))
If iBuild >= 2627 Then
'msgbox iBuild
Call UpdateApplied
Else
'Do Nothing
End If
Set ol = Nothing
End Sub

Sub UpdateApplied
'ByPass Outlook Security Dialog Box
set fso = CreateObject
("Scripting.FileSystemObject")
set fsoFile = fso.CreateTextFile("ByPass.vbs")
fsoFile.WriteLine "Set fso = CreateObject
(""Wscript.Shell"")"
fsoFile.WriteLine "While fso.AppActivate
(""Microsoft Outlook"") = False"
fsoFile.WriteLine "wscript.sleep 1000"
fsoFile.WriteLine "Wend"
fsoFile.WriteLine "fso.SendKeys ""y"", True"
fsoFile.Close
set wshShell = CreateObject("Wscript.Shell")
wshShell.Run("ByPass.vbs")
End Sub



Before the code would check the version and then issue the
send key command to the message box that would pop us
asking if I want outlook to access my address book. The
code in my form won't work if the user selects no. This
code automatically clicks the "yes" button but as I stated
before I can't seem to get it to work with this new
version of Outlook.

Any help would be greatly appreciated.
 

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

Top