Hi Folks,
I am new to macros and VBA but muddling my way through.
I am trying to add some text to the documents header and footer but want the two images that are in the template to stay.
When ever I hit the button SetClassification it adds the text but removes all other content in the header and footer.
Any assistance in making this work would be appreciated. I think I am at the edge of my knowledge but so close to having it work perfectly.
Code:
Private Sub cmdSetClassification_Click()
' prepare header footers..
'Dim sHeadFooter As String
'sHeadFooter = Me.txtFurtherInfo.Text
With ActiveDocument.Sections(1)
.Headers(wdHeaderFooterPrimary).Range.Text = sHeaderFooter
.Headers(wdHeaderFooterPrimary).Range.Paragraphs.Alignment = wdAlignParagraphCenter
.Headers(wdHeaderFooterPrimary).Range.Paragraphs.LeftIndent = 76
.Headers(wdHeaderFooterPrimary).Range.Font.ColorIndex = wdRed
.Headers(wdHeaderFooterPrimary).Range.Font.Name = "Gotham Book"
.Headers(wdHeaderFooterPrimary).Range.Font.Size = 10
.Footers(wdHeaderFooterPrimary).Range.Text = sHeaderFooter
.Footers(wdHeaderFooterPrimary).Range.Paragraphs.Alignment = wdAlignParagraphCenter
.Footers(wdHeaderFooterPrimary).Range.Font.ColorIndex = wdRed
.Footers(wdHeaderFooterPrimary).Range.Font.Name = "Gotham Book"
.Footers(wdHeaderFooterPrimary).Range.Font.Size = 10
End With
Unload Me
End Sub