GenerateDocument and document headers

Jan 10, 2013 at 1:04 PM


I'm using the GenerateDocument method in Word and it is working fine, except when the controls are placed in the document header or footer.

These controls are not being filled in these places, although they got filled when are placed in the body of the document.

Is there any way to fill controls in the document header or footer?

Thank you,


Jan 10, 2013 at 3:56 PM


Searching a little further, I found this post on msdn explaining why this happens.

According to the post and reviewing the codes Word.vb and WordHelper.vb, I think this can be fixed in the method SetContentControl, by getting all content controls in all document sections instead of getting only the controls in the Document object.

I will be glad if I could help some how updating the code or doing anything else.

Best Regards,