message attachment saved by Outlook.Attachment.SaveFileAs not open

  • Thread starter Thread starter arcfan
  • Start date Start date
A

arcfan

Team,

I use Outlook 2003 and in my add-in I save attachments in a share folder
(UNC). I don't see any issue while writing in to the shared folder but when I
attempt to read, the message does not open. I don't have google desktop
installed on my machine. Is there any resolution for this problem?

Regards,
Selvam.
 
Attempt to read it in code or in the user interface?

Are you saving the attachments as the correct type of files?
 
I'm trying to open the saved item manually using outlook 2007/2003. Just to
give a correct context, the user tries to open the item is not the owner of
the message... and the attachment gets stored in a remote share on network.

I think you mean the file extension by referring "the correct file
types?"... If so, yes. If not, I don't know how to set correct file type. OL
2003 object model does not have message type as a parameter in the SaveFileAs
method.

Method Signature
===========
Outlook.Attachment.SaveFileAs string

At the same time I don't have any issue with other files like images,
documents...

Regards,
Selvam.
 
What types of items are you having problems with, if not with images or
documents?

What happens if you go to the files in Windows Explorer and double-click on
it?

Please provide all the relevant information you have.

What do you mean by "I'm trying to open the saved item manually using
outlook 2007/2003"? How exactly are you trying to do that?
 
Ken,

Thanks for great response and follow-up.

Only with embedded mail item (message) as attachments thats where I have
problem with. That too not while saving the attachment (embedded mail
item/Message) in to the shared folder...

Only when opening the saved item... I use .msg extension for the embedded
mail item types and in explorer it showed as email message type files.

User double clicks on the item to open it up in outlook. User may use OL
2003 or OL 2007.

Please let me know if I can provide any other details.

Regards,
Selvam.
 
Are you sure that those embedded attachments are actually Outlook objects,
and not images or something else? How are you testing for that?

To be clear, if you find that MSG file in Windows Explorer and double-click
on it does it open as an Outlook item? Does it open at all?
 
Ken,

I really don't care about the attachment type. I save all attachment items
going through in for each and save them in shared folder (UNC).

The way how I test it, I explore the UNC path and see the items I saved
(doc, xls, jpeg, .... and .msg too). When I double on any item but .msg it
opens perfectly in a corresponding windows extension mapped application (.doc
in word, .xls in Excel...)

TO answer your question: "does it open as an Outlook item? Does it open at
all?"
Yes system recognize the item as outlook item and attempt to open the item
with outlook but fails with the following error message.


When I double click on .msg (I have OL 2007. OL 2007 was not launched when I
attempt to open the saved embedded message items) and I get the following..

---------------------------
Microsoft Office Outlook
---------------------------
Cannot start Microsoft Office Outlook. Cannot read the item.
---------------------------
OK
---------------------------

If I had OL 2007 launched already and double click on the saved embedded
message then I get the following error

---------------------------
Microsoft Office Outlook
---------------------------
Cannot read the item.
---------------------------
OK
---------------------------

I just used 2003 Outlook Object Model and saved the attachment. Why I'm not
able to open the .msg attachments? I can live with temporary solution for
some time. All I want to do is some way to see the save email item properties
and see what it is... I tried OutlookSpy and that did not help eiether.

I really don't find any documentation about this and badly need help from
experts like you... Please help.

Regards,
Selvam.
 
I'm interested in the attachment type because if you are saving embedded
images as MSG files you never will be able to open them. Only embedded
Outlook objects can be saved as MSG files and then reopened. The fact that
they cannot be opened when Outlook is running or not running already leads
me to believe that they aren't Outlook objects but some other type of
attachment.

Another test would be to try opening the saved files using code, with the
CreateItemFromTemplate() method. If that also fails then we're not dealing
with proper MSG files.

If you look at an attached Outlook object attachment using OutlookSpy you
will see the property PR_ATTACH_METHOD (0x37050003), which will be set to 5
(ATTACH_EMBEDDED_MSG).

You will also see another property, PR_ATTACH_DATA_OBJ (0x3701000D), that's
not there with other types of attachments.
 
Back
Top