
Adding attachment in Outlook: Can this be done?
The mapi attachment source is the location of the named file. Suppose, for
example, I had an image on drive C
Attachments,add( "C:\MyAttachment.jpg")
That's as simple as it gets. But if you really want to get {*filter*} with
this, you can specify an OLEtype with a type constant for the second
variable and then specify the roder in which this newly assigned attachment
is listed.
If you run the object browser, you'll find these types under
olAttachmentType
There's four of them:
olByReference = 4
olByValue =1
olEmbededItem =5
olOLE =6
A good source is:
http://www.*-*-*.com/
hth
Quote:
> I have been searching google for hours now and there are no examples
> out there.
> Here is my code so far: (it works by the way)
> Outlook.Application oApp = new Outlook.Application();
> Outlook._NameSpace oNameSpace = oApp.GetNamespace("MAPI");
> Outlook.MAPIFolder oSentFolder;
> Outlook._MailItem oMailItem =
> (Outlook._MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
> oSentFolder =
oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderSentMail);
Quote:
> oMailItem.Subject = "Client Server Program Test";
> oMailItem.Body = "This is a test of the body part";
> --The following is the line that I cannot get to work.
> oMailItem.SaveSentMessageFolder = oSentFolder;
> oMailItem.Send();
> The following is the definition for the add procedure.
> I cannot figure out what it wants when it says "object source, object
> type", etc, etc..
> Attachment.Add(Object Source,Object Type, Object Position,
> System.Object DisplayName)
> Any ideas would be great, thanks for your help.