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.
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.