Novacode.DocX.ApplyTemplate C# (CSharp) Method

ApplyTemplate() public method

Applies document template to the document. Document template may include styles, headers, footers, properties, etc. as well as text content.
The document template file not found.
public ApplyTemplate ( string templateFilePath, bool includeContent ) : void
templateFilePath string The path to the document template file.
includeContent bool Whether to copy the document template text content to document.
return void
        public void ApplyTemplate(string templateFilePath, bool includeContent)
        {
            if (!File.Exists(templateFilePath))
            {
                throw new FileNotFoundException(string.Format("File could not be found {0}", templateFilePath));
            }
            using (FileStream packageStream = new FileStream(templateFilePath, FileMode.Open, FileAccess.Read))
            {
                ApplyTemplate(packageStream, includeContent);
            }
        }

Same methods

DocX::ApplyTemplate ( Stream templateStream ) : void
DocX::ApplyTemplate ( Stream templateStream, bool includeContent ) : void
DocX::ApplyTemplate ( string templateFilePath ) : void