GenerateDocument and document headers

Jan 10, 2013 at 1:04 PM

Hello,

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,

Augusto

Jan 10, 2013 at 3:56 PM

 

Searching a little further, I found this post http://social.msdn.microsoft.com/forums/en-US/vsto/thread/622731fc-be0f-4b55-92a6-03b5e5df749b 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,

Augusto