Advertisement
2002C VB function enhancement #10277

MS Outlook 98 - Sending Email and Attachments

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

AI

ملخص الذكاء الاصطناعي: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

كود المصدر
original-source
Sub EmailFromOutlookInExcel() 'macro name
  Set myOlApp = CreateObject("Outlook.Application") 'opens Outlook
  Set MailItem = myOlApp.CreateItem(olMailItem)   ' opens new email
  Set myRecipient = MailItem.Recipients.Add("recipient@company.com")  '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
التعليقات الأصلية (3)
مسترجع من Wayback Machine