I have the following code:
Set MyOutlook = New Outlook.Application
Set MyMail = MyOutlook.CreateItem(olMailItem)
MyMail.To = "myname@myco.com"
MyMail.CC = ""
MyMail.BCC = Text1
MyMail.BodyFormat = olFormatHTML
MyMail.Subject = "Monthly Newsletter"
MyBodyText = "Here is the document"
Set myattachments = MyMail.Attachments
myattachments.Add "C:\JetComp.doc"
MyMail.SentOnBehalfOfName = "MyMailBox"
What I'd like it to do is to look at a combo box (combo16) and if the value is Ben, then my attachment should be BensAttachment, but if it combo box value is David, then my attachment should be DavidsAttachment, and so on.
Can someone help me out here please? Thanks in advance -- You guys are great!
Set MyOutlook = New Outlook.Application
Set MyMail = MyOutlook.CreateItem(olMailItem)
MyMail.To = "myname@myco.com"
MyMail.CC = ""
MyMail.BCC = Text1
MyMail.BodyFormat = olFormatHTML
MyMail.Subject = "Monthly Newsletter"
MyBodyText = "Here is the document"
Set myattachments = MyMail.Attachments
myattachments.Add "C:\JetComp.doc"
MyMail.SentOnBehalfOfName = "MyMailBox"
What I'd like it to do is to look at a combo box (combo16) and if the value is Ben, then my attachment should be BensAttachment, but if it combo box value is David, then my attachment should be DavidsAttachment, and so on.
Can someone help me out here please? Thanks in advance -- You guys are great!