Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

outlook attachments....

Status
Not open for further replies.

Norviking

Programmer
Nov 2, 2002
33
NO

Hi..

can anyone tell me how to add an attachment to an outlook object???

this is my code so far...

public void addToOutBox(string toValue, string subjectValue, string bodyValue, ArrayList documents)
{
//creates the MailItem object
Outlook._MailItem oMailItem = (Outlook._MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);

oMailItem.To = toValue;
oMailItem.Subject = subjectValue;
oMailItem.Body = bodyValue;

foreach(String item in documents)
{
oMailItem.Attachments.Add(item,??????


}
oMailItem.SaveSentMessageFolder = oOutboxFolder;



//adds it to the outbox
oMailItem.Send();

}

in theArraylist i pass to the function is an collection of adresses to the documents i want to attach.. ie c:\temp\temp.txt.

can anyone help. plz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top