[indent]
‘—————-Footer Section ——————————————-
‘————–remove protection———————–
If ActiveDocument.ProtectionType wdNoProtection Then
ActiveDocument.Unprotect
End If
If foot_add = True Then
‘————————————–Add Footer text————-
If foot_page = True Then ‘———–show text on first page
ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter = False
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text = txtourref.Text
Else ‘———— dont show footer text on first page
ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter = True
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text = txtourref.Text
End If
‘————————————-Add Page Numbers————-
End If
If foot_num = True Then
If foot_first = True Then ‘———–show number on first page
ActiveDocument.Sections(1).Footers(1).PageNumbers.Add PageNumberAlignment:= _
wdAlignPageNumberRight, FirstPage:=True
Else ‘—————-don’t show number on first page
ActiveDocument.Sections(1).Footers(1).PageNumbers.Add PageNumberAlignment:= _
wdAlignPageNumberRight, FirstPage:=False
End If
End If
‘———–reprotect————
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
noreset:=True
‘—————————-
[/indent]
This code is called from a form which has the following two option boxes on it.
Add Footer ?
Add Page Numbers ?
Selecting either of them, give the next options respectivly
Show Footer on first page ?
Show Page Number on First Page ?
The Values in the above code are as follows
Add Footer = foot_add
Add Pagenumbers = foot_num
Show footer on first page = foot_page
show page on first page = foot_first
nb. the idea behind this, is if they select footer then the text of the value txtourref.Text is entered into the footer.
I know the names are a bit confusing, but unfortunatly not my choice.
The problem i am having is, its all working well, except when i want to
Show Footer,
Show footer on first page
Show page number
show page number not on the first page
anyone see where i am going wrong