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
10
votes
6 answers

How to do search and replace involving fields in Microsoft Word?

I have a Word document with fields of the reference variety, which occur in the form "[field].[field]"--in other words, there's a period between the two fields. I want to globally replace this with a space. Word offers the ^d special character to…
user663031
8
votes
5 answers

Display date difference in MS Word field

I have an CV and would like to automatically update my age when opening. So, what formula should I insert in a MS Word field? Something like: {= {DATE} - {"01/01/1983"} }
serhio
  • 28,010
  • 62
  • 221
  • 374
6
votes
4 answers

Distinguishing Table of Contents in Word document

Does anyone know how when programmatically iterating through a word document, you can tell if a paragraph forms part of a table of contents (or indeed, anything else that forms part of a field). My reason for asking is that I have a VB program that…
LondonPhantom
  • 1,867
  • 3
  • 19
  • 26
6
votes
1 answer

Is it possible to use VBA functions in Word field codes?

I have a Word document with some functions. I want to access these functions in formula fields, but this was harder than anticipated. Let's say I have a function defined as Public Function Area(R As Double) As Double Area = 3.14 * R * R End…
Svein Bringsli
  • 5,640
  • 7
  • 41
  • 73
6
votes
1 answer

How do you substring a MERGEFIELD in Word?

This one has me puzzled. It seemed like an easy task, but the solution eludes me: - How do you substring a merge field in a Word template used for mail merging? For example, I have something like {MERGEFIELD barcodevalue} and I want to extract the…
Soraz
  • 6,610
  • 4
  • 31
  • 48
3
votes
0 answers

OpenXml SimpleField vs FieldCode

I have created a document template (Test1.docx file) which has several MERGEFields in it. When I open the template in xml, I see some of the fields as SimpleFields and some as FieldCodes. Now, if I make some changes to the template (like adding some…
A B
  • 31
  • 2
3
votes
1 answer

How do I display the previous month in a MS Word field?

I would like to learn how to display the name of the month before the current month in a Word 2003 document. I have tried over and over again to follow the instructions I found on the link below, but no matter what I try I get one of several…
Christa
  • 31
  • 1
  • 2
3
votes
2 answers

Primitive MailMerge using just delimited field names

Obviously the correct way for our app to generate a Word document based on a template is to encourage the admin users (who will look after the templates) to embed the correct merge fields or bookmarks in the template document. However in the past we…
hawbsl
  • 15,313
  • 25
  • 73
  • 114
3
votes
2 answers

Weird characters in a Microsoft Word document won't export/can't be searched

I have a document which has been sloppily authored. It's a dictionary that contains cyrillic characters. Most of the dictionary is manageable, but I'm stuck with one thing I need help with. Words have accented letters in them and they're mostly…
Захар Joe
  • 645
  • 2
  • 8
  • 14
2
votes
1 answer

Word html format: insert a custom TOC via field code

I am generating Word docs from html. Basically, I build a file with html and save it as a .doc. Then I open it in Word and apply a template. All good so far. I would like to automatically generate a custom TOC via the HTML ie when I am building the…
Murrah
  • 1,508
  • 1
  • 13
  • 26
2
votes
2 answers

How do I display the next month in a Microsoft Word field?

I'm needing to display the name of the month after the current month in a Word 2003 document. It's fairly easy to display the current month: { DATE \@ "MMMM" } At the time of this writing, this displays: September What I'm wanting to display is…
mezoid
  • 28,090
  • 37
  • 107
  • 148
2
votes
1 answer

Mailmerge Field not always saved the same way in Word .docx

I have created a Word document with Word 2003 and inserted some MergeField via the GUI. I have saved it as a .docx by using Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File Formats. Some Mergefields are stored as a…
Leo
  • 21
  • 3
2
votes
1 answer

MS Word: INCLUDEPICTURE field code

Sorry, Google hasnt been very helpful. I have a Word Document which references jpeg pictures stored at a different path. I always instruct word to Link in the file and modify the field code as: {INCLUDEPICTURE \d"..\\Relative…
Raj
  • 857
  • 11
  • 26
1
vote
2 answers

Get text of selected field code in Microsoft Word using AppleScript

I'm making a Automator to jump from citation in Word to the reference software(Zotero). But I can't find a AppleScript to extract text of selected field code (the first step). The field code in Word is ADDIN ZOTERO_ITEM CSL_CITATION…
heihei Han
  • 41
  • 6
1
vote
0 answers

INCLUDEPICTURE use an alternate jpg if MERGEFIELD "filename".jpg is not valid

I keep track of hikes we do in an EXCEL spreadsheet. I use WORD to create journal pages using a lot of MERGEFIELDS. I have clean maps of parks. After we do a hike, I use an editor to draw a route on the clean map of where we hiked producing a route…
Jack
  • 11
  • 1
1
2 3