We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to create documents based on a DOT-template

Thread ID:

Created:

Updated:

Platform:

Replies:

63057 Jun 27,2007 11:39 AM Jun 28,2007 04:29 AM Windows Forms 1
loading
Tags: DocIO
Christian Nein
Asked On June 27, 2007 11:39 AM

Hi,

we have an application generating MS Word based reports with Office 2003 Primary Interop Assemblies. I am currently evaluating XlsIO and DocIO becuase we are looking for a way to directly produce Word files without using MS Word.

My question is: how can I create a new document based upon an existing DOT-template with DocIO? This is a crucial feature for us because we provide the users with a template (DOT-file) which they can adapt to their individual needs.

Thanks in advance & best regards
Christian

Melba Winshia [Syncfusion]
Replied On June 28, 2007 04:29 AM

Hi Christian,

You can create a new document based upon an existing DOT-template with DocIO by using the following code snippet:

[c#]

WordDocument document = new WordDocument();

//Opening DOT-template
document.Open(@"..\..\Data\Essential DocIO.dot");

//Add a new section to the document.
IWSection section = document.AddSection();

//Adding a new paragraph to the section.
IWParagraph paragraph = section.AddParagraph();

//Insert Text into the paragraph
paragraph.AppendText( "Hello World!" );

//Saving the document to disk.
document.Save("Sample.doc");

Here is the sample for your reference:

http://websamples.syncfusion.com/samples/DocIO.Windows/63057/main.htm

Kindly let me know if you have any other questions.

Thanks,
Melba

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;