VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



MS Outlook 98 Sending Email and Attachments

by Michelle Grey (1 Submission)
Category: VB function enhancement
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (5 Votes)

This code will send email through MS Outlook 98, (or the most current version on your computer),
using MS Excel 7.0 or higher.

Assumes
You must have MS Outlook and MS Excel 7.0 or higher.
Code Returns
This code will open MS Outlook and open a new email message, insert the recipients email address, the attachment, the subject of the message, and send the email. **Note: This is with the aid of using John O'Donald's code and revising it to work for me.
Side Effects
Note: The MailItem.Send line may not work in Excel 97.

Rate MS Outlook 98 Sending Email and Attachments


Sub EmailFromOutlookInExcel() 'macro name
  Set myOlApp = CreateObject("Outlook.Application") 'opens Outlook
  Set MailItem = myOlApp.CreateItem(olMailItem)   ' opens new email
  Set myRecipient = MailItem.Recipients.Add("[email protected]")  'inserts recipient's email address
  MailItem.Subject = "Subject of message goes here"   'subject of the email
  Set myAttachments = MailItem.Attachments.Add("C:\foldername\filename")  'Path to Attachments
'Repeat this line if there are more Attachments
  MailItem.Send  'sends the email
End Sub

Download this snippet    Add to My Saved Code

MS Outlook 98 Sending Email and Attachments Comments

No comments have been posted about MS Outlook 98 Sending Email and Attachments. Why not be the first to post a comment about MS Outlook 98 Sending Email and Attachments.

Post your comment

Subject:
Message:
0/1000 characters