OpenSharedItem holds onto FileHandle

Joined
Aug 8, 2011
Messages
1
Reaction score
0
Good Day,

Im working on a C# Addin application using the OL 2007 Interops.

What Im seeing is that using Msg Files with Digital Signatures attached (Encrypted messages included) that I am unable to release the File handle for that message and as a result unable to delete it or use it later.

This will however work for other files that do not have a Digital Signature or that are not encrypted. AKA the file handle will not be held.

It appears that OpenSharedItem call is behaving differently for msgs that contain digital signatures.

// Code Sample

outlookItem = OutlookApplication.Session.OpenSharedItem("c:\testMsg.msg");

System.Runtime.InteropServices.Marshal.ReleaseComObject(outlookItem);

outlookItem = null;
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();

Thanks in Advance for any help!

Cheers

Damon
 

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