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.

word template

Thread ID:

Created:

Updated:

Platform:

Replies:

57060 Feb 25,2007 08:03 AM Feb 28,2007 07:04 AM Windows Forms 5
loading
Tags: DocIO
Peter Zagres
Asked On February 25, 2007 08:03 AM

I am trying to use DOCIO to process the attached document template. What I need to do is find each string of the form "{ REF EMSFORM_ }". Read the entire string into memory so that I can parse out the part and replace the entire value with text.

In addition if "{ REF EMSFORM_ }" is in a table I need to know which row and column the field is foiind in.

If this is poosible, can you help with a small sample?

template_ex.zip

Melba Winshia [Syncfusion]
Replied On February 26, 2007 07:33 AM

Hi Bob,

Thanks for your interest in Essential DocIO.

Issue 1:
-------

Could you please clarify the following?

1) Do you want to find each string of the form "{ REF EMSFORM_ }" and replace the entire value with text. If this is the case you can use the following code snippet.

[C#]

docSource1.Replace("{ REF EMSFORM_01EMPHO }","Replace",true,true);

Here is the sample for your reference:

FindAndReplace.zip

If this is not the case could you please provide more details regarding” find each string of the form "{ REF EMSFORM_ }". Read the entire string into memory so that I can parse out the part and replace the entire value with text” this issue? This would help me in investigating this issue further.

Issue 2:
--------

Currently we do not have support to find which row and column the field is found in. Sorry for the inconvenience.

Kindly let me know if you have any other questions.

Regards,
Melba

Peter Zagres
Replied On February 26, 2007 03:03 PM

Hi Melba, Thank you for the quick response. What I have is a product which gives a user the ability to create placeholders in a word document and then generate "form letters" using user defined fields (such as 01EMPHO, 03SCAH, etc.).

Our current software uses word api and MSWord::Fields for this purpose. I realize that DocIO does not support MSWord::Fields so have changed my MSWord::Fields to normal text (as you see in the template_ex.doc) and now I am trying to determine what I can do with DocIO.

So to answer your question, given the following paragraph from my template_ex.doc example,

Ingestion Toxicity: { REF EMSFORM_03IGATH }{ REF EMSFORM_03IGATA }

what I need to be able to do is find the regex "{ REG EMSFORM_* }", then get the contents of what was actually found, for example { REF EMSFORM_03IGATH }, and replace the entire string "{ REF EMSFORM_03IGATH }" with some other value. then go to the next one ("{ REF EMSFORM_03IGATA }" and do the same thing.

I would also like to know which paragraph (or any other DocIO container object available) the object was found in.

I am willing to do whatever it takes for me to use docio so any suggestions "outside of my box" is appreciated.

As far as tables, can I ask docio somehow, to give me all the tables in my document and then use the row /cell accessors to work the text? If so, how do I iterate through all the tables in my document?

thanks,
Bob

Melba Winshia [Syncfusion]
Replied On February 27, 2007 07:23 AM

Hi Bob,

1) It is possible to find the regex "{ REG EMSFORM_.* } by using the following code snippet.

[C#]

//Find occurance { REG EMSFORM_.*
TextRangesHolder[] matchHolders = doc.FindAll(new Regex("{ REF EMSFORM_.*", RegexOptions.None));

But it is not possible to get the contents of what was actually found. It is possible only to find the length.

2) Currently we do not have support to know which paragraph the object was found in. Sorry for the inconvenience.

3) Currently we do not have support to get the table in a document. Already we have a feature request [#953] regarding this issue.

Kindly let me know if you have any other questions.

Thanks,
Melba

Peter Zagres
Replied On February 27, 2007 11:12 AM

I can't find feature #953, can you provide a link?

Melba Winshia [Syncfusion]
Replied On February 28, 2007 07:04 AM

Hi Bob,

You can track the status of this feature from the following link:

http://www.syncfusion.com/support/features/docio/Default.aspx?ToDo=view&questId=953

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.

;