View Single Post
 
Old 10-27-2016, 11:47 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Cov_ATC View Post
I tried what you asked, manually adding a field, but it says
"Error! Unknown op code for conditional." when updating the field.
All that means is that you've input the field code incorrectly.
Quote:
Originally Posted by Cov_ATC View Post
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?
The code you posted creates ordinary braces, not field braces, for both the outer field and the nested fields. For the reasons given in post #5, that won't work.

I'd suggest that, for macro purposes, you create a custom building block using a working copy of the field, then simply insert that where & when required. To see what would be required to turn the text representation in to a working field code, see Convert Text Representations of Fields to Working Fields in the Mailmerge Tips & Tricks 'Sticky' thread, at: https://www.msofficeforums.com/mail-...ps-tricks.html - and that's for a text string that's already in the document and selected.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote