hi,
I have a document with a WTextBox in the HeadersFooters , when i change the PageSize and the Orientation of the document the WTextBox change the position.
So i tried to reposition the WTextBox by code but it doesn't work.
How can i do this ? Thanks
The code that i use:
For Each _section As WSection In a.Sections
_section.PageSetup.PageSize = PageSize.A3
_section.PageSetup.Orientation = PageOrientation.Landscape
For Each _element As Entity In _section.HeadersFooters.EvenHeader.ChildEntities
If TypeOf _element Is WParagraph Then
ShapeTestChangePosition(_element)
End If
Next
For Each _element As Entity In _section.HeadersFooters.FirstPageHeader.ChildEntities
If TypeOf _element Is WParagraph Then
ShapeTestChangePosition(_element)
End If
Next
For Each _element As Entity In _section.HeadersFooters.Header.ChildEntities
If TypeOf _element Is WParagraph Then
ShapeTestChangePosition(_element)
End If
Next
For Each _element As Entity In _section.HeadersFooters.OddHeader.ChildEntities
If TypeOf _element Is WParagraph Then
ShapeTestChangePosition(_element)
End If
Next
Next
The function :
Private Sub ShapeTestChangePosition(ByVal _element As WParagraph)
Dim para As WParagraph = _element
For Each _sselement As Entity In para.ChildEntities
If TypeOf _sselement Is WTextBox Then
Dim _textbox As WTextBox = _sselement
_textbox.TextBoxFormat.HorizontalPosition = HorizontalPosition.Right
_textbox.TextBoxFormat.VerticalPosition = VerticalPosition.Bottom
_textbox.TextBoxFormat.VerticalOrigin = VerticalOrigin.Margin
_textbox.TextBoxFormat.HorizontalOrigin = HorizontalOrigin.Page
u will found attached the document.
Thanks for help
Attachment:
exemple1_243674c2.rar