Saving Attachments

C

christie.sorenson

Hi,

I have an addin written in C#. If the user wants, I try to save the
attachments. This is the code I use:

public void
uploadattachements(Microsoft.Office.Interop.Outlook.Attachment pattach)
{
string temppath = Path.GetTempPath();
string saveto = temppath + pattach.FileName;
pattach.SaveAsFile(saveto);

...
}

This does work 90% of the time. However, on occasion, the user gets an
error message that says:

"Cannot save the attachment. You don't have appropriate permission to
perform this operation."

Any ideas of why this happens?

Thanks,
Christie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top