F
freeman642
I have written a small application using ActiveExplorer, the thing is
if an email is not selected I still want to run the script, how do I
say if an email is not selected then still run the script. I guess I
am looking at an if statement, but when do I check it? I am guessing
it is at the ActiveExplorer set up, because if the is not one when
this runs it closes it with an error message. The script below is
what
I have tried if it hasn got an email it puts up a messagebox.
Dim OlApp As New Outlook.Application
Dim OlExp As Outlook.Explorer
Dim OlSel As Outlook.Selection
Dim OlItem As Outlook.MailItem
Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")
If olApp.ActiveExplorer IsNot nothing then
Set OlExp = OlApp.ActiveExplorer
Set OlSel = OlExp.Selection
Set OlItem = OlSel.Item(1)
Else
Msgbox("No email selected")
End if
.......
Any ideas gratefully recieved I am pulling my hair out.
Thanks John
if an email is not selected I still want to run the script, how do I
say if an email is not selected then still run the script. I guess I
am looking at an if statement, but when do I check it? I am guessing
it is at the ActiveExplorer set up, because if the is not one when
this runs it closes it with an error message. The script below is
what
I have tried if it hasn got an email it puts up a messagebox.
Dim OlApp As New Outlook.Application
Dim OlExp As Outlook.Explorer
Dim OlSel As Outlook.Selection
Dim OlItem As Outlook.MailItem
Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")
If olApp.ActiveExplorer IsNot nothing then
Set OlExp = OlApp.ActiveExplorer
Set OlSel = OlExp.Selection
Set OlItem = OlSel.Item(1)
Else
Msgbox("No email selected")
End if
.......
Any ideas gratefully recieved I am pulling my hair out.
Thanks John