Questions tagged [field-codes]

Field codes are used as placeholders in Microsoft Word to put dynamically changing text, such as the date and time, into a document. They’re also used for fields to support mail merge of form letters, labels, etc.  Use this tag for questions about manually creating fields to achieve a specific effect, or managing fields automatically created and inserted by Word (e.g., figure and table numbers).  Also use the tag for your version of Microsoft Word.

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

REF field omits nbsp in formatting

I'm trying to cross-refer a figure and apply some simple formatting to the cross-reference like this: ...as shown in Fig._{ REF _Ref30011011 \# "0,_c" \h }. which should result in ...as shown in ...
0
votes
1answer
93 views

Open Word Document Without Updating Fields

We have some documents with Date fields (field code: DATE \@ "dd MMMM yyyy") in our document store. When opening those documents, Word automatically updates the field to show today's date rather than ...
1
vote
1answer
60 views

Sum up field codes not working right

I have values brought into a Word from another software in this format: example 1: 2 000,00 $ example 2: 50,00 $ example 3: 211,50 $ Since Word does not allow to do maths on numbers of that format, ...
0
votes
0answers
106 views

Can Word calculate how many days have passed since a given date?

My Word document mentions one date, and I'd like to create a field that calculates how many days have passed since that date. I know how to create a field that inserts today's date, and I know ...
0
votes
0answers
18 views

Can I change a mergefield in multiple documents at once?

Let's say I have {MERGEFIELD a} in a bunch of documents but need to change it to {MERGEFIELD b} (or more accurately, replace it) then save the document, is there a way to automate this? I'm talking ...
0
votes
0answers
44 views

How to assign text to Field codes

Aside from using a Macro as suggested here or the very clumsy 'Advanced Property' Dialogue how can a simple user populate/add/set the value of a field code? I have a document with cover page and the ...
0
votes
0answers
28 views

How to use Sharepoint-provided Quickparts (Document Properties) in MS Word Field Codes?

I want to use Document Properties that are passed down from a document content type from Sharepoint in IF-Statements in Word (Field Codes). The goal is to automate contract creation using a template ...
0
votes
1answer
43 views

How to convert a search string to a field?

I have a document with many occurrences of INCLUDEPICTURE "imagename.png". Instead of having to select the text and press Ctrl+F9, I want to do it automatically. Is it possible to convert the pattern ...
0
votes
0answers
67 views

MS Word 2013 | IncludeText contains paragraph marks invisible to VBA

In a Word 2013 document I have an INCLUDETEXT field followed by some text: |--THE FIELD ↓------------| |---------SOME TEXT ↓---------------------| { INCLUDETEXT MyFile.docx } A quick brown fox jumps ...
1
vote
0answers
22 views

Returning the page number in entire multisection document [duplicate]

I have a multisection document, so want page numbers are continuing the previous page number. I did used { PAGE } for returning the page number, but it returns the page number in the current section. ...
0
votes
1answer
533 views

Insert Mergefield conditionally based on other Mergefield - MS Word

In MS Word '16, I'm trying to insert a Mergefield based on a Mergefield, but I can't seem to get the syntax correct. { IF { MERGEFIELD A * MERGEFORMAT } = "RP2" "{ MERGEFIELD B * MERGEFORMAT }" "{ ...
3
votes
2answers
431 views

Word: how to find `_Refxxxxxxxxx` codes for manual cross-referencing?

When I use the Cross-reference dialog for figure and table cross-references, Word creates a new field with a reference number, e.g.: { REF _Ref530727267 \h } How can I get the _Refxxxxxxxxx codes ...
0
votes
1answer
249 views

How to insert multiple field codes to same field in MS Word?

I am trying to achieve following numbering scheme for a loooon word document: [Section 1] [formula] (1.1) [formula] (1.2) [formula] (1.3) [Section 2] [formula] (2.1) [formula] (2.2) [...
0
votes
1answer
71 views

MS Word: Insert a page of a field selection in

I would like to know if there is a way to insert text or a page based off field selection in Microsoft Word? I am working on a template that when opens: 1. Prompts for name of project, and parts ...
0
votes
1answer
211 views

cross reference content from current word forms

with the legacy word form I could insert a formtext field { FORMTEXT } and show the content in a new place by using a new field { REF text1 \h } where is the name text1 and which is automatically ...
0
votes
2answers
803 views

Word: How do I find all locked fields in a document?

is it possible to get a list of all the fields I used in a word document? I want to find out which field is locked without going through each field separately. Something similar to the the list when ...
0
votes
1answer
40 views

Why is there no entry to show/hide the field code in the (mouse) context menue for certain fields (word)?

To show/hide the field code of a single field I usually use Shift+F9. But sometimes I need the context menu (for example when working with a tablet with a screen keyboard that does not have the "F"-...
1
vote
2answers
649 views

Controlling the formatting of seq fields inside word equations

So I have several appendices that look something like this: Appendix A: Equations Appendix B: Sample Calculations etc. The letter is controlled as such: Appendix [{seq AppL \*ALPHABETIC}]: Example ...
0
votes
1answer
50 views

select data based on value of a field

I have a file with several entries providing IDs and another file with other entries subdivided in different fields separate by a TAB. I need to select the records of the second file based on matching ...
1
vote
2answers
132 views

{page} variable in Word 2016 not updating in a formula

In a footer in Word 2016 (Windows 10), if I place {page} on its own, it updates correctly; however, if I place it in a formula like {={page}*2}}, it only displays the correct value on the first page ...
0
votes
1answer
3k views

Outlook: what variables are available in Quick Steps?

In Outlook (2016) what variables and/or formatting codes are available for use when creating a Quick Step? For example in "Forward" the provided subject line is FW: <subject>. I'd like to ...
0
votes
1answer
279 views

Can I build a Word mergefield using other fields to complete the name?

I have a list of images (one per state) that I need to pull into my template and normally use a regular mergefield e.g., {MERGEFIELD "Image_FL_09252017"}. The image name is a combination of the state ...
0
votes
1answer
360 views

Field code IF statement not working

I have a simple IF statement which should be checking whether a docvariable is set to YES or NO. Regardless of whether it's Y/N, the document is including the "Some text here" part and the second ...
0
votes
1answer
466 views

How to remove soft line break in the field that from styleRef in Word 2013?

I create a header in WORD 2013 that contain a field from my chapter style ref. The problem is chapter title has a soft line break, I want to remove it in header, how to do it?
0
votes
2answers
287 views

MS Word - Quick Parts' field update

I have a MS Word protected document with some locked parts (not editable by users) and some editable fields (inserted by Quick fields> Field) that resume the value of some document properties (...
2
votes
1answer
390 views

Word 2016: Using StyleRef for Heading #s in Header differently

I have a document that requires the heading to contain the item number (level 3 heading) that is being continued onto that page from the previous page. Using the Field insert and StyleRef, I can make ...
2
votes
1answer
435 views

Conditional field in MS Word

I want to insert a field in the footer that will display the text "hello" if the page number is lesser than or equal to 2, and "bye" otherwise. How to do it? I have tried IF {PAGE}<=2 "hello" "bye"...
1
vote
1answer
1k views

Concatenate to a field without using a separate field?

How can I concatenate a space to a mail merge field in Word? Ideally: The space should be part of the field The space should be omitted if the field is empty
2
votes
1answer
463 views

MS Word 2013 | Create custom Field Code

I have a document in which I make heavy use of references to tables, graphs etc. like so: (see Table 25, page 236). This is a piece of text with two fields in it. Now, the Create a Cross-Reference ...
1
vote
0answers
75 views

Why does Word 2016 remove Field Code switches in .odt?

When editing .odt files in Word 2016 using the { [REF] Bookmark [Switches ] } field code the document seems to work fine. For example referencing 1.2.3.4 Heading with { REF _Ref1234 \w } results in 1....
-1
votes
2answers
307 views

How to insert line break in Word cross-reference

I have a cross-reference to heading text with a long heading, and I want to put a line break in the middle to make it more readable. What I tried: - Putting the cursor where I want the break and ...
1
vote
1answer
2k views

Word fields - IF statement not working as expected due to quote/speech marks

I've got a couple of merge fields that are using this syntax { IF {DOCVARIABLE "variable1" } = "" "" "(the {QUOTE 34}{DOCVARIABLE "variable2" }{QUOTE 34})" } If variable1 is empty, it should do ...
1
vote
1answer
2k views

Word macro to auto-update formula field without Ctrl+A, F9

I want a formula field to update automatically when its source field (another row in the same table) is updated, without having to update/recalculate the field value by pressing F9. Is this possible? ...
0
votes
1answer
328 views

Word 2017 won't Find/Replace text within field

I have a MS Word 2016 book manuscript with lots of citations. I'm using the APA Style but want vary from it to suppress the year in citations for authors with only one entry in my bibliography. E.g., ...
0
votes
1answer
2k views

How can I hide part of a caption in the document but show it in the contents?

I have the inverse problem to this user. I have a lot of figures that have the same caption. This makes the figure contents table look pretty repetitive and uninformative, like this: Image of the ...
1
vote
1answer
714 views

MS Word VBA Error: “The item with the specified name wasn't found”

I'm trying to set up a macro to adjust the field code of cross-referenced items so that only the numbers show, e.g. 3 instead of Figure 3. I've found online that \# "0" can be added to the field ...
0
votes
1answer
959 views

Adding static text to a field

I have added hyperlinked cross-references to my Word document, like this: I would like the word 'Section' to also be hyperlinked. Manually adding a hyperlink isn't working because not all the ...
1
vote
1answer
103 views

Fields in Word: OR function

I'm using fields for a complex mailmerge. I'd like to use an OR function, but I can't seem to get it to work; if a=0 or a="" I'm assuming I must follow the excel format; OR(a=0; a="") I do find the OR ...
0
votes
1answer
798 views

Field code in Word that is conditional based on the presence of a style

I have a Word template with a special table of contents associated with an "Appendix" paragraph style. Sometimes documents that use the template will use that style and sometimes they don't. The ...
4
votes
1answer
3k views

How do I avoid broken cross-references when moving figure captions?

In MS Word, I often find that moving figure captions in a document breaks cross-references to the figure number. Below is a simple example, in which a caption was added by right-clicking on an image, ...
0
votes
0answers
41 views

Word - styling part of field data before it's inserted into word?

I use a case management system at work that generates Word documents by inserting data from its database using fields. I have a couple of fields that I need to style (bold, capitalize and underline), ...
0
votes
1answer
336 views

Word 2013 custom text in cross-reference stopped working

I noticed today that custom text in cross references in my document stopped working. When I started working on the doc I followed the answer in this question so whenever I wanted a cross reference to ...
1
vote
1answer
2k views

How to link Microsoft Word Field Codes and References

Sorry if this question has already been asked, I can't find it anywhere on the internet. I have a document that shows many photos, and beneath each photo has a caption, eg: "Photo 1: A picture of a ...
4
votes
2answers
21k views

How do I remove all field codes from a Word document

Field codes often find its way into Word documents (e.g. graph references, citations etc.). When we want to submit the completed document to someone else, often it would be necessary to remove field ...
2
votes
1answer
2k views

Cross Refence Appendix without Label

I have a document with a lot of appendixes, normally I cross reference the appendix just like any paragraph number and it brings in the entire label, for example "Appendix A." Now in my document I ...
0
votes
1answer
118 views

Microsoft Office Field Code regex on filename?

Is it possible to filter the filename of the Word file to present it inside the document? Let's say I have the following filename: Acme Co - Project XYZ - Code #123 - Year 15.docx I need to get Acme ...
0
votes
2answers
1k views

MS Word field code error “!Syntax Error, :”

I am trying to modify a reference to only show a certain number of characters of text on the left of the string. To test my formula, I used the following field text: { =LEFT( "BLAH12345" , 3 ) } ...
3
votes
1answer
1k views

Prompt to enter (custom) document property in Microsoft Word

I created a template with a custom document property called "myproperty". I can access this using fields with the DOCPROPERTY "myproperty" command. I want to make Word prompt the user for a value and ...
2
votes
1answer
2k views

In Microsoft Word, can I show Heading1 > Heading2 breadcrumb navigation in the header/footer?

In Microsoft Word (2016), I want to be able to specify a header with a sort of breadcrumb navigation showing the previous titles / heading text, to give the reader an overview of where you are in the ...
4
votes
1answer
643 views

Microsoft word 2013 - if statement not working

I have a field code with a strange behavior. When I put the code, { IF NUMPAGES=NUMPAGES "A" "B" } I get A as expected however, when I reverse this, ie { IF NUMPAGES<>NUMPAGES "A" "B" } I ...