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.

DOCIO WordDocument

Thread ID:

Created:

Updated:

Platform:

Replies:

116969 Jul 11,2014 09:57 AM Jul 15,2014 09:05 AM Windows Forms 3
loading
Tags: DocIO
Edvin
Asked On July 11, 2014 09:57 AM

Hi, 

I',m using WordDocument as mailmerge generator  within loop inside windows service

How i should properly dispose worddocument instance ?
There is no dispose method or IDisposable interface implemented.

Now i create one instance per loop.
Should i share only one for all loops. If so, how properly cleanup worddocument befor every loop.

What do you suggest ?

Thanks for advance.

Edvin



Nithya B [Syncfusion]
Replied On July 14, 2014 09:02 AM

Hi Edvin,

Thank you for using Syncfusion products.

In the DocIO DOM we have reference properties in each element to preserve the parent, child relation between all the document elements. Whereas in Close() method we have explicitly unlink the child elements from its parent element by removing the reference to the parent element and clear all the child elements from parent’s child collection. This operation is required specifically to remove references of all the instances used by DocIO DOM, in order to ensure no instance is referred anywhere/alive in the current scope and the used resources can be freed.

 

Kindly invoke Close() method of WordDocument class to free the resources used  by each WordDocument instance. Please find the code snippet below for your reference.

[C#]

 

//Releases the resources used by the WordDocument instance.

doc.Close();

 

[VB.NET]

 

'Releases the resources used by the WordDocument instance.

doc.Close()

Let me know if you have any questions.

 

Regards,

Nithya


Edvin
Replied On July 15, 2014 05:47 AM

Thanks for explanation.

Edvin

Nithya B [Syncfusion]
Replied On July 15, 2014 09:05 AM

Hi Edvin

Thanks for update.

Please let us know if you have any other questions.

 

Regards,

Nithya


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.

;