denbihe
06-11-2012, 07:35 AM
Hi everybody,
I'm a bit frustrated to create a different header in every page. So I deciced to put the visuals in the header, and assign a macro to create the text part.
I came up with this macro: which creates a table, writes the text and positions it over the header.
But the problem is I always need to be on the first row. Sometimes I have a table which continues from first page, so I can not run this efficiently.
Is there a way to make
Range:=Selection.Range
not selection but a x,y position maybe?
I need your advices, thanks a lot in advance.
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1, NumColumns:=1, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=wdAutoFitFixed
Selection.TypeText Text:="Header 1 Text"
Selection.Tables(1).Select
Selection.Tables(1).Borders.Enable = False
Selection.Tables(1).Rows.HorizontalPosition = -25
Selection.Tables(1).Rows.VerticalPosition = -75
Selection.Font.Name = "Arial"
Selection.Font.Size = 18
Selection.Font.ColorIndex = wdWhite
I'm a bit frustrated to create a different header in every page. So I deciced to put the visuals in the header, and assign a macro to create the text part.
I came up with this macro: which creates a table, writes the text and positions it over the header.
But the problem is I always need to be on the first row. Sometimes I have a table which continues from first page, so I can not run this efficiently.
Is there a way to make
Range:=Selection.Range
not selection but a x,y position maybe?
I need your advices, thanks a lot in advance.
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1, NumColumns:=1, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=wdAutoFitFixed
Selection.TypeText Text:="Header 1 Text"
Selection.Tables(1).Select
Selection.Tables(1).Borders.Enable = False
Selection.Tables(1).Rows.HorizontalPosition = -25
Selection.Tables(1).Rows.VerticalPosition = -75
Selection.Font.Name = "Arial"
Selection.Font.Size = 18
Selection.Font.ColorIndex = wdWhite