WinForms

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class Template

    Show / Hide Table of Contents

    Class Template

    Represents the template document that is attached to the Word document.

    Inheritance
    System.Object
    Template
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.DocIO.DLS
    Assembly: Syncfusion.DocIO.Base.dll
    Syntax
    public class Template
    Examples

    The following code example demonstrates how to specify the path for the attached template document.

    private void Button1_Click(System.Object sender, System.EventArgs e)
    {
        //Create a new Word document
        WordDocument document = new WordDocument("Template.docx");
        //Set the path for the attached template document
        document.AttachedTemplate.Path = "../Data/Attachedtemplate.dotm";
        //Save and close the Word document instance
        document.Save("Sample.docx", FormatType.Docx);
        document.Close();
    }
    Private Sub button_Click(sender As Object, e As EventArgs)
        'Create a new Word document
        Dim document As New WordDocument("Template.docx")
        'Set the path for the attached template document
        document.AttachedTemplate.Path = "../Data/Attachedtemplate.dotm"
        'Save and close the Word document instance
        document.Save("Sample.docx", FormatType.Docx)
        document.Close()
    End Sub

    Properties

    Path

    Gets or sets the path of the attached template document.

    Declaration
    public string Path { get; set; }
    Property Value
    Type Description
    System.String

    The string that specifies the path to attached template document.

    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved