Questions tagged [word-field]

Only use this tag for Code Fields (inside of { }, viewable with Alt+F9) in MS Word

Fields are powerful tools available in .

They can be used for mailing/mergemail, document properties, calculations, ... and more!


More details in those articles :

http://www.techrepublic.com/blog/10-things/10-things-you-need-to-know-about-using-word-fields/ http://www.addbalance.com/usersguide/fields.htm http://gregmaxey.com/word_tip_pages/word_fields.html

Lists of fields :

Word 2010, Word for Mac 2011

Word 2016, Word 2013, Word 2016 for Mac

51 questions
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
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
4
votes
2 answers

Can you use a web service as a datasource for a mailmerge

Some clients of ours want to use data (SQL Server backend) in a web application we've developed to generate some documents (agreements, contracts, etc). They'd also prefer to have the document templates to be in a form they are familiar with and…
Dustin Hodges
  • 4,110
  • 3
  • 26
  • 41
4
votes
3 answers

Filling Word template fields with C#

Currently, if I create a Word Document Template with fields, and then fill them using C#, I do it similar to this... object missing = Type.Missing; Word.Application app = new Word.Application(); Word.Document doc = app.Documents.Open("file.doc", ref…
erosebe
  • 927
  • 3
  • 16
  • 31
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

Setting up a nested field in Word using VBA

I am building a large document in pieces from templates. Each template has a keyword #OVERALLPAGENUMBER# in the footer which I am programmatically replacing (using Excel VBA) with a field. If all I needed were that document's page number, the…
Alain
  • 26,663
  • 20
  • 114
  • 184
2
votes
3 answers

How to refer to Word Field by name in VBA Code?

I want to update a word field content using VBA. I already have a code that works, but I have to refer to the field's index instead of field's name, which I would prefer. The code I have is as follows: Sub UpdateField() Dim myString As String …
strajano
  • 59
  • 1
  • 5
2
votes
1 answer

Date format with Quickpart Database in Word

I try to change the date format in a quickpart database function. The format is in American (mm/d/yyyy) but i want to change in the French format (dd.MM.yyyy). This is my code : DATABASE \d "C:\Users\taagede1\Dropbox\Samaritains\Soldes et …
DenisG
  • 21
  • 1
2
votes
1 answer

How do we add field code for Word using word javascript api

I want to add field code using word JavaScript API. I checked the API documentation but I found nothing regarding this. Is there a way to do it in this API?
Nishara MJ
  • 509
  • 4
  • 13
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

Remove MailMerge data source via OpenXML

I have some code that uses Open XML to open up a .docx file, find all MailMerge fields, and replace them with data (ignoring the datasource that may have been provided). I initially tested this against a document created in Office 2007 and it seemed…
Dan
  • 533
  • 8
  • 29
2
votes
2 answers

Using VBA in MS Word 2007 to define page elements?

I'd like to be able to create a page element which I can feed text and it will form itself into the preferred layout. For instance: {MACRO DocumentIntro("Introduction to Business Studies", "FP015", "Teachers' Guide")} with that as a field, the…
bugmagnet
  • 7,631
  • 8
  • 69
  • 131
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 2007 - How to set up placeholder text to mimic text but not formatting

I'm probably biting off more than I can chew with this particular problem, but I'll try to be as specific as possible in case it's within my scope. Disclaimer: I'm not terribly experienced with MS Word, beyond simple data entry/some formatting,…
jvance
  • 410
  • 7
  • 17
1
2 3 4