Security is often hard to diagnose from a distance, but I'll offer some
speculation :-)
The document needs full trust too, before it will run the assembly. If the
user saves the document to a normal folder on his or her own computer, it
gets full trust automatically. But if the user opens a document that is
attached to an e-mail message, the document runs in Internet zone and does
not have full trust. The user can easily work around that by saving the
document somewhere like the desktop or My Documents, and then opening the
saved copy.
If the user opens a document that is on a network share that has not been
granted full trust explicitly, the document does not have full trust and
won't run the code. It's not usually good to grant full trust to any network
share where users might want to run documents, in case malicious code gets
put there and receives the trust automatically. But there might be a way
that you could grant full trust to documents on network shares, without
granting full trust to all code. Have a look at this topic in the
documentation and see if could use msosec.dll:
http://msdn2.microsoft.com/en-us/library/9w6bd8f1(VS.80).aspx

Signature
Harry Miller
This posting is provided "AS IS" with no warranties, and confers no rights.
> Hello,
> I have deployed our VSTO 2005 Excel application to a network share
[quoted text clipped - 19 lines]
> required permissions to execute.
> at
Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.H
andleOnlineOffline(Exception
> e, String basePath, String filePath)
> at
[quoted text clipped - 12 lines]
> Thanks for any help
> Urs
urs.eichmann@gmail.com - 29 May 2006 08:15 GMT
Thanks Harry for this suggestion. However, as far as I can see you
still have to specify specific network share folders when you implement
the procedures suggested in this document. Also, they say that adding
msosec.dll to the security policy will have a negative effect on the
performance of all managed applications :-(
Seems like we have to live with these restrictions... I already wonder
how I can explain this to my clients...
best regards,
Urs