![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |