Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Adding Objects as attachments to mails in outlook using c#

Geek News

Adding Objects as attachments to mails in outlook using c#
"dev" <roshni.ramnani[ at ]gmail.com> 1/5/2007 9:14:16 AM
I have developed an add-in to outlook in c# using vs2005 and vsto. I
want to be able to attach objects (of a user -defined class) created in
the project to a mail item in c#. I would also appreciate it if you
could give me some - details on the use of the 4 attachment types in
outlook.

Re: Adding Objects as attachments to mails in outlook using c#
"Sue Mosher [MVP-Outlook]" <suemvp[ at ]outlookcode.com> 1/5/2007 1:51:34 PM
The only kind of attachments you can make programmatically with the Outlook object model embedded and linked files and Outlook items. If Word is the email editor, you may have other options through the Word.Document object returned by MailItem.GetInspector.WordEditor and its InlineShapes.Add method. (Sometimes the Word macro recorder can be your friend.)

As for the four Outlook.OlAttachmentType enumeration values:

olByReference Link to a file stored in the file system
olByValue File embedded in the Outlook item
olEmbeddedItem Outlook item embedded in the Outlook item
olOLE Content embedded using Object Linking and Embedding (OLE) technology

Only the first three can be used with Outlook's Attachments.Add method.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"dev" <roshni.ramnani[ at ]gmail.com> wrote in message news:1167988456.342550.300350[ at ]q40g2000cwq.googlegroups.com...
[Quoted Text]
>I have developed an add-in to outlook in c# using vs2005 and vsto. I
> want to be able to attach objects (of a user -defined class) created in
> the project to a mail item in c#. I would also appreciate it if you
> could give me some - details on the use of the 4 attachment types in
> outlook.
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net