Hi,
I'm using a VSTO .dot template document with a dll behind to populate a
document from my application by passing custom parameters to the document so
it knows which record to fetch from the database.
This template, when loaded from my app is then a new word document that the
user can save where he/she wishes.
My problem is, when you come to re-open the document created from my
template, there is still a VSTO .dll attached and the user is prompted with
the dialog '.net security policy does not permit etc to run from etc' which
I don't want as this document has no more need for my codebehind .dll.
How do I detach the .dll from the new document once it has been populated?
Any ideas? Am I missing something in the help files? Or is this approach
completely wrong?

Signature
I'm sure you can figure this out if you want to email me directly...
David Pedley - millitec.com - dave@
Rohan - 28 Jun 2004 16:40 GMT
I also wondered how to have code that ran when opening a new document
based on the template, but then 'un-hooking' the code from the
resulting document so that it was just an ordinary letter or fax again.
The answer was to delete the custom document properties as follows (I
also show how you add some new custom document properties).
ThisDocument.CustomDocumentProperties("_AssemblyLocation0").Delete()ThisDocument.CustomDocumentProperties("_AssemblyName0").Delete()
With ThisDocument.CustomDocumentProperties
.Add("NameID", False, Office.MsoDocProperties.msoPropertyTypeNumber,
14543)
.Add("ClientCode", False,
Office.MsoDocProperties.msoPropertyTypeString, "GS1564")
.Add("AutoGeneratedDate", False,
Office.MsoDocProperties.msoPropertyTypeDate, Now())
End With
see also:
http://dotnetjunkies.com/WebLog/rohancragg/archive/2004/05/12/13424.aspx
> Hi,
>
[quoted text clipped - 18 lines]
>
> David Pedley - millitec.com - dave@