Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / VS Tools for Office / June 2004

Tip: Looking for answers? Try searching our database.

New from vsto template - how to detach dll??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave - 28 Jun 2004 11:34 GMT
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@

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.