K
Kerri
Hi,
I'm working on a vba macro (which will be used with a
UserForm) that will insert a text box in the all headers.
The headers will already have shapes or text located in
them so I do not want that text to be deleted. Basically
I have Different First page and no other sections. So I
want the box to appear in the Different First Page and
Primary Headers. I hope I don't have to create two macros
in order to have the textbox appear in multiple sections.
or do I? I also noticed that if I don't use the If stmt
and only say wdHeaderFooterPrimary, then it will only
insert the textbox on the current page header and I then
have to go to the first page and run the macro again for
that page. ;o(
Well, Headers will be the death of me yet. All
suggestions are welcome and most appreciated!!
Thank you
Kerri
Here is a trimed down version of my macro.
Sub SideAddress()
If ActiveWindow.View.SeekView = wdHeaderFooterPrimary =
True Then
Resume
Else: ActiveWindow.View.SeekView = wdSeekFirstPageHeader
End If
Set Textbox1 = Selection.HeaderFooter.Shapes.AddTextbox
(msoTextOrientationHorizontal, _
18#, 360#, 72#, 72#)
'I left out the formatting of textbox since that wasn't
the issue.
'Insert text into the textbox
Textbox1.Select
With Selection
.TypeText Text:="Name"
.TypeParagraph
.TypeText Text:="Address"
End With
'Activate Main document when finished with header
ActiveWindow.View.SeekView = wdSeekMainDocument
End Sub
I'm working on a vba macro (which will be used with a
UserForm) that will insert a text box in the all headers.
The headers will already have shapes or text located in
them so I do not want that text to be deleted. Basically
I have Different First page and no other sections. So I
want the box to appear in the Different First Page and
Primary Headers. I hope I don't have to create two macros
in order to have the textbox appear in multiple sections.
or do I? I also noticed that if I don't use the If stmt
and only say wdHeaderFooterPrimary, then it will only
insert the textbox on the current page header and I then
have to go to the first page and run the macro again for
that page. ;o(
Well, Headers will be the death of me yet. All
suggestions are welcome and most appreciated!!
Thank you
Kerri
Here is a trimed down version of my macro.
Sub SideAddress()
If ActiveWindow.View.SeekView = wdHeaderFooterPrimary =
True Then
Resume
Else: ActiveWindow.View.SeekView = wdSeekFirstPageHeader
End If
Set Textbox1 = Selection.HeaderFooter.Shapes.AddTextbox
(msoTextOrientationHorizontal, _
18#, 360#, 72#, 72#)
'I left out the formatting of textbox since that wasn't
the issue.
'Insert text into the textbox
Textbox1.Select
With Selection
.TypeText Text:="Name"
.TypeParagraph
.TypeText Text:="Address"
End With
'Activate Main document when finished with header
ActiveWindow.View.SeekView = wdSeekMainDocument
End Sub