View Single Post
 
Old 10-24-2016, 03:43 AM
Cov_ATC Cov_ATC is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Oct 2016
Posts: 5
Cov_ATC is on a distinguished road
Default

Hi Macropod

I tried what you asked, manually adding a field, but it says
"Error! Unknown op code for conditional." when updating the field.

Im sorry to ask again, but I really need a code to add-in a field.
The reason being is that the Doc is constantly being reviewed and amended, with paragraphs and sections removed or added.
I need the editors to be able to, when adding a new Section, press a customised button on the Word ribbon, which will add a Section Break where the cursor is on the document and also automatically, just before the section break, add in the field code.
So they don't have to go over the whole document and do it themselves (as they have only basic Word knowledge)

Could you help me please?

I have tried this but with no avail,

Code:
Sub AddNextPageSectionBreakWithFieldCode()
 
   Selection.Fields.Add Selection.Range, wdFieldType.wdFieldIf, "{=MOD({PAGE},2)}= 1, {QUOTE 12} This page intentionally left blank", False
   
 With Selection
    'Adds a new line
    .TypeParagraph
   
    'puts a Next Page SectionBreak
    .InsertBreak Type:=wdSectionBreakNextPage
 End With
End Sub
Reply With Quote