Questions tagged [fieldcodes]

Fields in Word are used as placeholders for data that might change in a document and for creating form letters and labels in mail-merge documents.

Fields in Word are used as placeholders for data that might change in a document and for creating form letters and labels in mail-merge documents.

Word inserts fields automatically when you use particular commands, such as when you insert a page number, when you insert a document building block such as a cover page, or when you create a table of contents. You can also manually insert fields to automate aspects of your document, such as merging data from a data source or performing calculations.

Source: https://support.office.com/

43 questions
1
vote
1 answer

MS Word table formula for value of cell above

Is there a way in MS Word to get in table the value of the cell above for calculation? I want to calculate the percentage of the sum. I can build the sum with the formular =SUM(ABOVE), but I couldn't find a link to the value of the cell above. XXX…
wittich
  • 2,079
  • 2
  • 27
  • 50
1
vote
1 answer

How to round a value using field codes in MS Word 2010?

I am using field codes to dynamic calculate some things. Through an ASK field I am getting an value. {ASK myvalue "Enter a value"} Now I use this for some calculations and want to display it as a rounded value to a specified number of decimal…
1
vote
1 answer

Word MERGEFIELD wildcard not correctly matching

Below is my MERGEFIELD code: { IF { MERGEFIELD Subs_State } = "GA" "blah blah" "{ IF { MERGEFIELD CEOrgStates } = "*GA*" "blah blah" ""} "} I'm pulling records from a MS Access database. My goal is to check whether a record has Subs_State field…
Tam N.
  • 2,687
  • 9
  • 30
  • 29
1
vote
1 answer

How to retain Field Codes after Word MailMerge (e.g.{FILENAME} in footer of document)

I have inserted a field {FILENAME} in the footer of my source document. When I generate a MailMerge with this source document and a data file the resulting document does not show the field code - it has been replaced by hardcoded text representing…
Andrew Magerman
  • 1,394
  • 1
  • 13
  • 23
1
vote
2 answers

In Word, how can I alter mail merge data programmatically with VBA?

I have a Word document that is used as the source document for a mail merge. I can edit the document, but not the data being used for the merge. I need to transform some of the data in the data source (specifically, I need to take numbers (e.g.…
asciiphil
  • 519
  • 4
  • 17
1
vote
1 answer

Word 2010 can Field added via QuickParts be given an ID and later referenced in document.Fields collection

I need to add a few fields to a Word 2010 DOTX template which are to be populated automatically with custom content at "run time" when the document is opened in a C# program using Word Interop services. I don't see any way to assign a unique name…
Tim
  • 8,669
  • 31
  • 105
  • 183
1
vote
1 answer

test for error returned by TOC field code

I am trying to test whether any "figure captions" exist before I create a Table of Figures. I have a line of code that works: {IF {TOC \h \z \c "Figure"} = {TOC \h \z \c "blarghel"} " No table" "Entries exist"} (field codes, of course),…
Carl Witthoft
  • 20,573
  • 9
  • 43
  • 73
0
votes
0 answers

Create field codes for citations in word document when using Quarto (or Rmarkdown)

Problem: I would like the word document output from Quarto (or Rmarkdown) to generate field codes for citations. Current Behavior: The citations are generated as simple text with no underlying field code. This means it is not practical to do further…
MikeS
  • 103
  • 7
0
votes
0 answers

Use MS-Word Field code to replace text from variable

I have written a document that uses variables in field codes, so when the system is updated, I only need to update one location in the document. i.e.: {Set SWVersion "3.5.2" \*MergeFormat} I'm hoping to use this same field in a file naming…
Scott
  • 161
  • 5
  • 13
0
votes
0 answers

Find text from field and replace with the field in MS WORD (VBA)

I have a list of fields (citations from ZOTERO) in one section of MS WORD document and some text with citations in next section. I'd like to match all citations with the text from each field and replace the citation with the field. It can be done…
0
votes
2 answers

Failure to change ruby text's font via field codes

I run the below macro code that is capable of adding phonetic pinyin to all the selected Chinese text at once. However, that code can only add the ruby text using default settings for font and I need to modify the the font, positioning, and font…
0
votes
1 answer

VBA functions in one workbook, but not another, no errors found

I have an .xlsm workbook where this VBA (see below) interacts with a Word Document to replace field codes. Seems straight forward, and it worked great... Then I copied and pasted the code into a new .xlsm, checked the cells, sheet names, and…
0
votes
0 answers

What is the best way to change the order of Field Codes in .docx and .doc files using C#?

Apologies if this question is vague. I have thousands of .docx and .doc files that need to be altered so that the field codes have a changed order. It is a relatively simple job to do manually, however the sheer number of files will take forever to…
Jon Wall
  • 1
  • 1
0
votes
1 answer

DOCVARIABLES in Word not initializing

I need to add a bunch of DOCVARIABLES to a word document for my work. The end goal is to use C# to easily ask a user what values need to go into those variables, then automatically generate the word document from the template with empty…
0
votes
1 answer

Excel to Word: Manipulating Field Codes and switches

I am building a Userform (In Excel) that gives the user the following options on Excel to Word automation: All these options are inspired by this Microsoft article. Update links automatically / manually / break link (\a switch) Store graphical data…