Need to add IF/THEN statement to Macro
Posted by Brian Adkins on March 31, 2000 10:05 AM
On September 27, 1999 at 12:03:42 on this message board, the following post was made explaining how to email a document through a macro using MS Outlook.
-------------------
Sub SendMail()
Dim OL As Object, MailSendItem As Object
Set OL = CreateObject("Outlook.Application")
Set MailSendItem = OL.CreateItem(olMailItem)
With MailSendItem
.Subject = "Test"
.Body = "Testing 1,2,3"
.To = "bob@bob.com; sam@sam.com"
.Attachments.Add ("C:\File.txt")
.Send
End With
End Sub
----------------------------
Now, this code works great but I was wondering, if the user isn't using MS Outlook, what code would have to be added to kickback a message box saying something like, "Sorry, cannot use this macro. Outlook is not installed". I'm assuming it would be some sort of If/Then statement but, I don't know how to write the "IF" part of it.
Anyone able to point me in the right direction?