Free Support Forum - aspose.com

Error in DocumentBuilder.MoveToBookmark(String)

In the latest versions of Aspose.Words, the attached code does not work. The latest version I know it worked in was v 9.4.0.0

The document.docx referenced in the code is a Word-file with two bookmarks:
TopBannerImage in the header and BottomBannerImage in the footer.

The pngs referenced are simply pictures I want to add at the bookmarked positions.

In the earlier dll, the header was placed in the header and the footer was placed in the footer, but in the latest dlls, the footer is placed on top of the header and on multiple paged documents, the following pages are just as screwed up.

Is this an error or a new feature ;) ? It keeps me from upgrading to the latest dlls. Please advice if I should do this differently to ensure future compatibility.

Hello

Thanks for your request. Could you please try using RelativeVerticalPosition.Paragraph?

shape.RelativeVerticalPosition = Aspose.Words.Drawing.RelativeVerticalPosition.Paragraph;

If this does not help you, please attach your document here for testing.

Best regards,

AndreyN:

Thanks for your request. Could you please try using RelativeVerticalPosition.Paragraph? <?xml:namespace prefix = o />

shape.RelativeVerticalPosition = Aspose.Words.Drawing.RelativeVerticalPosition.Paragraph;

This works. Thank you so much and for a fast reply! Was there an error in the insidemargin that caused it to change behavior?

Hello

It is perfect, that you already found the solution. If you need more assistance, I will be glad to help you.
It seems there were some problems in older versions of Aspose.Words, but currently it is difficult to say why the behavior was different.

Best regards,