Skip to content

Latest commit

 

History

History
56 lines (34 loc) · 1.82 KB

README.md

File metadata and controls

56 lines (34 loc) · 1.82 KB

MvvX.Plugins.Open-XML-SDK

Using the Open-XML-SDK-Plugin for MvvmCross is quite simple. The plugin injects the IWordManager interface into the IoC container. Each resolve to IWordManager from the Mvx.Resolve() will create a new instance of the service.

Quality and packaging

Build status Quality Gate Status

Nuget

API

The API of WordManager is very easy to understand and to use.

WordManager Open existing template

In order to open a template, call the OpenDocFromTemplate method

	
    var resourceName = "<Set full template file path here>"; // ex : C:\temp\template.dotx
    var finalFilePath = "<Set saved new document file path here>"; // ex : C:\temp\createdDoc.docx
	
    using (var word = Mvx.Resolve<WordManager>())
    {
        word.OpenDocFromTemplate(resourceName, finalFilePath, true);

        word.SaveDoc();
        word.CloseDoc();
    }
	

WordManager Insert text on bookmark

Using the name of the database and the folder on the client device where to store database files:

	
    var resourceName = "<Set full template file path here>"; // ex : C:\temp\template.dotx
    var finalFilePath = "<Set saved new document file path here>"; // ex : C:\temp\createdDoc.docx
	
    using (var word = Mvx.Resolve<WordManager>())
    {
        word.OpenDocFromTemplate(resourceName, finalFilePath, true);

        word.SaveDoc();
        word.CloseDoc();
    }
	

To be complete...