Skip to content

SANHNV/OpenXMLSDK.Engine

 
 

Repository files navigation

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...

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%