A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Open an attachement of type olEmbeddeditem



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 15th 06, 12:04 AM posted to microsoft.public.outlook.program_addins
Nuno
external usenet poster
 
Posts: 3
Default Open an attachement of type olEmbeddeditem

Hello!

I hant to now wich is the best way to get a _MailItem from an
attachment that is of the type olEmbeddeditem?

It's necessary to save it to disk and open like a mail item? if is how
this is done? or we can do something like this:

....
AttachmentPtr att = attac-Item(l);
_MailItemPtr pMailSubItem;
hr = att-QueryInterface(__uuidof(_MailItem),(void**)&pMail SubItem);

This way does not work, it gives E_NOINTERFACE


What's the best way to do it?

Thanks
Nuno

Ads
  #2  
Old January 15th 06, 10:50 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Open an attachement of type olEmbeddeditem

The best you can do in Outlook Object Model is to save the attachment as an
MSG file, then open it using the Shell API to make Outlook display it.
In Extended MAPI you will need to open the PR_ATTACH_DATA_OBJ property
(IAttach::OpenProperty) as IMessage
You can use Redemption (url below) to access the embedded message using
Attachment.EmbeddedMsg

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Nuno" wrote in message
ups.com...
Hello!

I hant to now wich is the best way to get a _MailItem from an
attachment that is of the type olEmbeddeditem?

It's necessary to save it to disk and open like a mail item? if is how
this is done? or we can do something like this:

...
AttachmentPtr att = attac-Item(l);
_MailItemPtr pMailSubItem;
hr = att-QueryInterface(__uuidof(_MailItem),(void**)&pMail SubItem);

This way does not work, it gives E_NOINTERFACE


What's the best way to do it?

Thanks
Nuno



  #3  
Old January 16th 06, 10:50 AM posted to microsoft.public.outlook.program_addins
Nuno
external usenet poster
 
Posts: 3
Default Open an attachement of type olEmbeddeditem

Thanks for the response i already handle the problem... is like you
said, i save the attach as a msg file and then i open it.

Here's some example code:

AttachmentPtr att = attac-Item(l);
hr=piAtt-SaveAsFile(_bstr_t(strFile));
_MailItemPtr pMailSubItem =
att-GetApplication()-CreateItemFromTemplate(_bstr_t(strFile));
if(pMailSubItem)
{
//do something with it
}

But thanks anyway...

Nuno

  #4  
Old January 16th 06, 05:09 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Open an attachement of type olEmbeddeditem

Just keep in mind that CreateItemFromTemplate(0 does not preserve sender and
receiver properties...

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Nuno" wrote in message
ups.com...
Thanks for the response i already handle the problem... is like you
said, i save the attach as a msg file and then i open it.

Here's some example code:

AttachmentPtr att = attac-Item(l);
hr=piAtt-SaveAsFile(_bstr_t(strFile));
_MailItemPtr pMailSubItem =
att-GetApplication()-CreateItemFromTemplate(_bstr_t(strFile));
if(pMailSubItem)
{
//do something with it
}

But thanks anyway...

Nuno



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I sort events on my calendar by label or type? djrtowle Outlook - Calandaring 5 August 15th 06 09:16 PM
How to Produce a Mail Merged email with attachement Ian Mitchell Outlook - General Queries 4 February 27th 06 03:15 AM
Attachement in Calendar NikiC Outlook - Calandaring 1 February 16th 06 09:50 PM
How can I print to a dayrunner type calendar lou Outlook - Calandaring 1 February 10th 06 09:54 AM
how do i find type of mail opened? Sue Mosher [MVP-Outlook] Outlook - Using Forms 0 February 6th 06 08:13 PM


All times are GMT +1. The time now is 07:53 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.