word-field

Is it possible to refresh fields of a word document with Office.js?

橙三吉。 提交于 2021-02-11 06:11:25
问题 I have word documents with fields that display the value of custom document properties as such: `{ DOCPROPERTY example \* MERGEFORMAT }` Whenever my custom property is modified, in order for the changes to be displayed in my document, I need to select the field(s) and right-click -> update them. I was wondering if office.js had anything that would help me automatically update fields in my document. 回答1: There is no API to do this currently. But it is an excellent idea. Please suggest it at

Is it possible to refresh fields of a word document with Office.js?

百般思念 提交于 2021-02-11 06:09:48
问题 I have word documents with fields that display the value of custom document properties as such: `{ DOCPROPERTY example \* MERGEFORMAT }` Whenever my custom property is modified, in order for the changes to be displayed in my document, I need to select the field(s) and right-click -> update them. I was wondering if office.js had anything that would help me automatically update fields in my document. 回答1: There is no API to do this currently. But it is an excellent idea. Please suggest it at

How to merge entirely different pages based on value of merge field

ε祈祈猫儿з 提交于 2021-02-08 09:37:11
问题 At my office we use documents with merge fields from Microsoft Word for a number of different functions. However, I can't find a way to merge entire pages based on the value of a merge field. For instance, there are different forms you have to use to notarize documents in different state. I want to set it up so that if the state chosen is MN, the document will generate the notary form for Minnesota, if the state chosen is NC, the document will generate the notary form for NC, etc. Is this

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

*爱你&永不变心* 提交于 2020-01-03 03:37:05
问题 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 October...and for the life of me I cannot work out what needs to be done. I've been trying to follow the advice on addbalance but without much luck: { = { Date \@ "MMMM" } + 1 } Does anyone know what command I need to write to be able to accomplish

Filling Word template fields with C#

跟風遠走 提交于 2020-01-02 05:23:44
问题 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 missing, true); Word.FormFields fields = doc.FormFields; fields[2].Result = "foo" fields[3].Result = "bar" Is there a better way to reference the fields? I notice when creating the template I can add a Title and a Tag to the field, but I haven't

Calculation fields not working with dates

最后都变了- 提交于 2019-12-30 11:34:17
问题 I have seen quite a lot of examples looking for a solution, so I'm pretty certain that this possible. I have Custom Document Properties (properly defined as date) containing dates , and I want to make operations on them : {={ DOCPROPERTY DateFieldTest }+1 \@"d MMMM YYYY"} 'toggle DOCPROPERTY Field {=07/04/2016+1 \@"d MMMM YYYY"} 'toggle calculation field 1 I have also tried : {=DATE(YEAR({ DOCPROPERTY DateFieldTest }),MONTH({ DOCPROPERTY DateFieldTest }),DAY({ DOCPROPERTY DateFieldTest })+1)

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

旧时模样 提交于 2019-12-19 10:18:24
问题 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? 回答1: There is no direct support in the API for adding fields, i.e. you will have to create Open XML containing the field. You can then insert this Open XML in your document (something a long the lines of the following untested snippet): // Run a batch operation against the Word object model. Word.run(function (context) { // Queue a

Primitive MailMerge using just delimited field names

▼魔方 西西 提交于 2019-12-14 01:35:30
问题 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 have found our typical admin user who ordinarily doesn't use MailMerge or any of the other "advanced" features in Word is significantly put off by having to use merge fields. We have tried doing it for them, producing documentation, lots of

Setting up a nested field in Word using VBA

只谈情不闲聊 提交于 2019-12-12 22:30:19
问题 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 following would suffice: Dim storyRange As Object 'Word.Range For Each storyRange In oDoc.StoryRanges Do With storyRange.Find .Text = "#OVERALLPAGENUMBER#" .Wrap = 1 'wdFindContinue .Execute While .found storyRange.Fields.Add Range:=storyRange, Type:=-1,

MS Word: Mailmerge hyperlinks with query get URL string with a MERGEFIELD

拟墨画扇 提交于 2019-12-12 05:03:24
问题 I'm trying to send an email merging one document (.docx) with a contacts database (via OleDB). Using MS Word 2007, it seems easy (it works for easy things: name, address, ...) but I can't find how fill an query-get URLD string with a merge field inside an hyperlink. An hyperlink like: Click here where here is an hyperlink to http://domain.com/test.php?contact=contact@contactdomain.com where contact@contactdomain.com is the address of the contact, a merge field. I've tried the special/merge