Inserting Fields Dynamically


#1

Dmitry
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I hope you remember our discussions reference to using Aspose.Word Merging features for my current project.

I just want to check with you - in my current application, users will be selecting the fields from the populate fields at run time to make the template. In other words, mergefield will be done dynamically in the document
For example - user want to make a new template. Here user will choose the template from a window. Further, the template and a list of pre-defined fields will be populated. Say it had 50 different fields. This window will have three buttons - "Insert Field", "Save" and "Cancel". Now, user will be decide whether he/she want to enter the number of fields in the template. User will just select the position on the template using the mouse and then select the field and then click once on the "Insert Field" and the appropriate field will be entered in the template. Say user had entered 10 fields. User will save this template by clicking on the button - "Save". Application will then generate a document using the above aconstructed template and Word mergefield facility.[Here data is already stored in SQL Server]

Currently, I was using Word Merge Field to add the field.

wrdMergeFields = wrdMailMerge.Fields;

wrdMergeFields.Add(wrdSelection.Range, selectedItem.ToString());

I was wondering whether we can do the same using Aspose.Word also or not.

It is a very crucial functionality for us, depending on this we will take a decision whether we can go for Aspose.Word or not

Regards
Amit


#2

Hi Amit,

Of course I remember our discussion but after reading this post I must disappoint you. Unfortunately, Aspose.Word does not allow to select a position in the template using the mouse and it has no visual functionality at all. We will certainly implement something like that in the future, but currently the only way you can manipulate documents is programmatic.