We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Can i modify the header programatically in v2.1.5.0 of Aspose.Word(s)

Hi,

we have a project which uses v2.1.5.0, and has run very successfully since within our project since released to customer over 18mths ago.

lately we have had a change request from the customer asking would it be possible to put some document specific data into the header.

the document is currently very basic. it is simply 2 tables. eg


referral data fields



intervention data fields


intervention data is a table of numerous rows which can run over onto another page hence the need for a header.

i tried to create another table and then place this in the header but my version doesnt allow nested merge regions.

so is there someway programatically i can add data into the header?

i use the following code to create the document:-

'Perform the mail merge - with a DATA-TABLES

doc.MailMerge.ExecuteWithRegions(dsResults)

'This is useful if you want to delete any MERGEFIELD records that might
'be left at the end of the table.

doc.MailMerge.DeleteFields()

Return doc

is there something i can add into this just to allow me to add text to a field within the header?

any help is greatly appreciated.

Cheers,
Craig


Sorry, I don't quite understand your problem. If you want to put some data in the document header, then why putting it in the table. And why nested mail merge problem. If you have the merge field inside the document header it is in no way will be nested. You can always perform several mail merges on the document. Just prepare different data sources for different fields. You can also do simple mail merges and then mail merge with regions - all with the same document.

Please provide a more detailed description of your task and also some sample documents to let me help you further.

Best regards,

ahhh i never realised you could use multiple merges on the one document!!

thats sorts it & also opens a lot of other avenues to us!!

Cheers,
Craig