Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Nov 08, 2011 1:20 pm

Hi,

I'm curently looking for a .Net library for word .doc files generation.

So your product looks perfect for my need .... but .... just a point :

Is is possible to insert a field in a field ?

The goal is to build document that use INCLUDETEXT with customizable path ... like that :

Code: Select all
{ INCLUDETEXT "{DOCPROPERTY myPath}\\theDoc.doc" }


Thanks for help.

eNovware.com
 
Posts: 3
Joined: Tue Nov 08, 2011 1:08 pm

Wed Nov 09, 2011 10:17 am

Dear eNovware,

So sorry for the inconvenience! Becausre our technical support is a little busy, could you please kindly give us a little more time? We promise we will give you a solution ASAP. Thanks for your understanding and wish you have a great day!
e-iceblue support
User avatar

iceblue support
 
Posts: 240
Joined: Tue Dec 21, 2010 2:56 am

Thu Nov 10, 2011 7:35 am

Hello eNovware,

Sorry for any inconveniences caused by us and thank you for your patience.

So far away,Spire.Doc don't support the function of "field in field". We tried to realise the function by MS Word, but we didn't find the field "myPath". MS Word don't have the field "myPath" too. So maybe you need to get a new method to achieve the goal.

We will enhance the function of Spire.Doc gradually. If you still have any other questions, please don't hesitate to contact us.
Sorry again.

Have a nice day.
Tina
Technical Support/Developer,
e-iceblue Support Team
User avatar

Tina.Lin
 
Posts: 152
Joined: Tue Sep 13, 2011 5:37 am

Thu Nov 10, 2011 12:58 pm

"myPath" is a CustomDoc property, that's why you haven't it in Word (we fills this property when generating our files)

In conclusion, I cannot add a field in a field using Spire.doc ... that's a bad news ...

OK, anyway, thanks for your cooperation.

eNovware.com
 
Posts: 3
Joined: Tue Nov 08, 2011 1:08 pm

Thu Nov 10, 2011 1:04 pm

In case that could help you, my application actually use Automation for inserting field in field ...

Here is the piece of code that do that :

Code: Select all
                    oDoc.Application.Selection.ClearFormatting();
                    object field_type = Word.WdFieldType.wdFieldEmpty;
                    //
// insert the first field : INCLUDETEXT
                    oDoc.Application.Selection.Fields.Add(oDoc.Application.Selection.Range, ref field_type, myData.oMissing, ref myData.oFalse);
                    oDoc.Application.Selection.TypeText( "INCLUDETEXT \"");
                    //
// insert the second field : DOCPROPERTY
                    oDoc.Application.Selection.Fields.Add(oDoc.Application.Selection.Range, ref field_type, myData.oMissing, ref myData.oFalse);
                    oDoc.Application.Selection.TypeText("DOCPROPERTY myPath");
                    //
// go out the second field
                    oDoc.Application.Selection.MoveRight(Word.WdUnits.wdCharacter, 2);
                    //
// insert end of INCLUDETEXTE data (filename)
                    oDoc.Application.Selection.TypeText( "example.doc" + "\"");
                    //
// go out the first field
                    oDoc.Application.Selection.EndKey(Word.WdUnits.wdLine);


Note : myPath is a string like "c:\documents\"

eNovware.com
 
Posts: 3
Joined: Tue Nov 08, 2011 1:08 pm

Fri Nov 11, 2011 3:17 am

It's a good solution. Thanks for your great suggestion. That's really helpful. We will improve our product to aquire this feature ASAP.

Please do not hesitate to give us your feedback on our products. Have a great day!
e-iceblue support
User avatar

iceblue support
 
Posts: 240
Joined: Tue Dec 21, 2010 2:56 am

Return to Spire.Doc