IO.Path.GetFileNameWithoutExtension(fileName), ". String.Concat(IO.Path.GetDirectoryName(fileName), " \", _ Private Function exportAsXps( ByVal fileName As String) As Boolean Try ' Starts a background instance of Word 2007 ' and adds the specified document to the The following XAML code could accomplish this: ![]() On the presentation layer, we want to let the user choose a Word 2007 document by clicking a button and automatically show the exported document from within a WPF DocumentViewer control. .Runtime.v9.0.dllĪs you can understand, we’re adding a reference to all VSTO assemblies for Visual Studio 2008 but without creating an Office solution.Then, add a reference to the following assemblies: Using the codeįirst of all, open Visual Studio 2008 and create a new WPF Application for Visual Basic. Two are the prerequisites you must adhere to: you need to have Microsoft Word 2007 installed and the XPS/PDF exporter add-in. We’ll see this in action inside a WPF application. In fact, we can create XPS documents by writing a few lines of Visual Basic 2008 code and referencing Visual Studio Tools for Office main assemblies. NET Framework 3.x exposes several classes to read, write, and manage XPS documents, in this article, I want to show you how to create XPS documents starting from Microsoft Word 2007 documents (. Manipulating this kind of documents via code (particularly writing) is not often simple, especially if you need to add pictures, thumbnails, digital signatures, and other supported contents.Įven if the. ![]() ![]() NET Framework 3.x fully supports this kind of documents which can be created and manipulated with extreme precision. This file format was thought of as a standard for documents portability in fact, XPS documents can be read on every system without having installed the originating application (as it is for PDF documents). NET Framework 3.0, Microsoft introduced a new file format called XPS (XML Paper Specifications) with the.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |