How does ZZ remove the association between documents and vsto code?

Source: Internet
Author: User

(Article-Harry Miller: http://blogs.msdn.com/vsto/archive/2008/07/18/removing-customization-code-before-e-mailing-a-document.aspx)

Create vsto custom for a word/Excel documentCodeLater, subsequent copies of this document will also be associated with the code, even if you change the document name when you "Save as", the Association still exists. Every time the document is opened, it will try to find the associated vsto code and start running. Question: What if we need to send documents to external personnel (such as customers and suppliers )? They do not have the permission to access our internal network, and the document cannot find the associated code, so a nasty error dialog box will pop up, tell the confused user "the user cannot find or load the customProgramFor common office users, this is the same information as tianshu.

So sometimes we need to remove the association between the document and the vsto code before distributing the document.

One way is to manually delete the "_ assemblyname" and "_ assemblylocation" attributes in the "properties-Advanced properties-custom" project of the document.

Another method is to program and use the "serverdocument. removecustomization ()" method to remove the association between documents and code. The sample program in the vsto document contains the relevant code for reference.

Related Resources:

Serverdocument. removecustomization method (2007 Office System)
Serverdocument. removecustomization method (2003 Office System)
Serverdocument sample code
Use the serverdocument class to manage documents on the server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.