|
Visual Studio Tools for Office(c) Using C# with Excel, Word, Outlook, and InfoPath Authors: Carter E., Lippert E. Published year: Pages: 172-175/214 |
VSTO Support for the WordML File FormatVSTO has several features that support the WordML file format. Although you cannot create a new VSTO Word project in the WordML format, you can take a Word document that has been customized in VSTO and save it as WordML. Because WordML preserves all the features of the Word document, the document continues to work and the VSTO customization will run even when saved in WordML format. VSTO's ServerDocument object can open a file in the WordML file format without starting Word on the server and manipulate the cached data and application manifest inside the Word document. For more information on ServerDocument, see Chapter 18, "Server Data Scenarios" and Chapter 20, "Deployment." VSTO also supports an easy way of attaching a VSTO customization to an uncustomized WordML document. If you add a document property to the Word document called _AssemblyName and set it to "*" and add a second property to the Word doc ument called _AssemblyLocation and set it to the URL to a VSTO deploy manifest (as described in Chapter 20), Word will attach the customization specified in the deploy manifest when the document is opened on the client. This feature was added because it makes it much easier to attach a VSTO customization when using a WordML document or an XSLT transformation that transforms XML data to a WordML format document. When using this feature, make sure you start with a clean document that does not have a VSTO customization already associated with it. A document that is customized with a VSTO customization will already have its _AssemblyName and _AssemblyLocation properties set and it will have a hidden ActiveX control embedded in it that contains the data island. The whole point of using this feature is to not have to deal with the embedded ActiveX control in the document because it becomes unwieldy when generating WordML or writing an XSLT transform. |
ConclusionThis chapter examined the XML schema mapping features in Word. You have learned how to create a schema using Visual Studio that will work well with Word's schema mapping features. This chapter also covered how to export XML from a Word document using Word's Save Data option when saving as XML. The chapter also addressed using XSLT files to effectively import XML into a Word document. You also learned how to work with VSTO's XMLNode and XMLNodes controls created for a mapped schema. The end of the chapter discussed VSTO's support for the WordML format. |
Chapter 23. Developing COM Add-Ins for Word and Excel
Introduction to Add-Ins Scenarios for Using Add-Ins How a COM Add-In Is Registered Implementing IDTExtensibility2 Writing a COM Add-In Using Visual Studio The Pitfalls of MsCoree.dll COM Interop and Regasm.exe Shimming: A Solution to the Problems with MsCoree.dll Conclusion |
Introduction to Add-InsOffice provides a number of patterns to extend the functionality of Office applications. The most common patterns are these:
This chapter covers how to write COM add-ins in C# for Word and Excel. It also describes how COM add-ins are registered in the registry and why there is another step called "shimming" that must be taken before deploying a managed COM add-in. Outlook Add-InsVSTO 2005 supports building a new kind of "VSTO-style" add-in for Outlook 2003. The VSTO Outlook add-in project is the preferred way to build Outlook add-ins for Outlook 2003 and is described in Chapter 24, "Creating Outlook Add-Ins with VSTO." The VSTO Outlook add-in project fixes many of the issues in COM add-in development discussed in this chapter as well as some additional Outlook-specific issues. The only reason to write a managed COM add-in for Outlook following the instructions in this chapter is if it must run in versions of Outlook older than Outlook 2003. |
|
Visual Studio Tools for Office(c) Using C# with Excel, Word, Outlook, and InfoPath Authors: Carter E., Lippert E. Published year: Pages: 172-175/214 |