Visual Studio Development Bookmark and Share   
 index > Visual Studio Tools for Office > saving a workbook with customization - without customization
 

saving a workbook with customization - without customization

Hello all,

I have built an excel workbook project using vsto.

Now, say the user is trying to save the file with the 'save as' dialog - when the copied file is opened it still has the vsto customization and it causes to an error..

I know the method ServerDocument.RemoveCustomization, but it ain't helpful because I don't have an event that says when saving is complete only - BeforeSave,

so what can I do to remove the customization of the saved workbook without needing to write my own code???

Thanks..!

chskhi  Sunday, April 06, 2008 11:00 AM

Hi,

There is no event that you can get notified when document saving performed over. If you want to do it that way, you need adopt timer and some synchronizing logical.

In fact, I think we can try to avoid the error message you said that popped up after saving the file to another place. Excel 2003 Document embedded the manifest in the file itself. The manifest points to where customization assembly locates. With manifest in itself, VSTO solution loader knows where and how to load corresponding assembly codes when the document is opened.

You will receive that error after save the file to another location because, by default, the assembly location use relative path in embedded manifest. This makes Excel only tries to look for the assembly in the same location it exist. All we need to do is modify the assembly location using full path format.

There is a tool can help you manage it. See this article:

http://msdn2.microsoft.com/en-us/library/aa537185(office.11).aspx

Thanks,

Ji

Ji.Zhou  Tuesday, April 08, 2008 6:25 AM

Hi,

There is no event that you can get notified when document saving performed over. If you want to do it that way, you need adopt timer and some synchronizing logical.

In fact, I think we can try to avoid the error message you said that popped up after saving the file to another place. Excel 2003 Document embedded the manifest in the file itself. The manifest points to where customization assembly locates. With manifest in itself, VSTO solution loader knows where and how to load corresponding assembly codes when the document is opened.

You will receive that error after save the file to another location because, by default, the assembly location use relative path in embedded manifest. This makes Excel only tries to look for the assembly in the same location it exist. All we need to do is modify the assembly location using full path format.

There is a tool can help you manage it. See this article:

http://msdn2.microsoft.com/en-us/library/aa537185(office.11).aspx

Thanks,

Ji

Ji.Zhou  Tuesday, April 08, 2008 6:25 AM

You can use google to search for other answers

Custom Search

More Threads

• Can I save information inside a Word Document
• Selecting a range based on CustomXML Markup (Word 2007 Add-in)
• Shared Excel Worksheet on Sharepoint
• Does Microsoft Office InfoPath 2003 Toolkit for Visual Studio 2005 available to download?
• Access VBA macro from VSTO codebehind
• Adding custom fields to form region
• help with install myaddin1 in ither computer
• Application-level smart tags using VSTO v3 for Word 2007?
• OutlookAddIn and Word -> Sent To Mail Recepient (Sent as Attachment) problem
• Will There Be An Outlook 12 Template?