Questions tagged [docvariable]
21 questions
15
votes
3 answers
What is a DOCVARIABLE in word
What is a DOCVARIABLE in Microsoft Word 2003? How do I set it? How do I make it display in my Word document?

joe
- 16,988
- 36
- 94
- 131
6
votes
4 answers
Filling in a docvariable in Word docx using C#
I've done this a hundred times in VB 6 but it's driving me nuts using C# 2008 and Word 2007. I created a docx file with two docvariables:
Some text here....
{docvariable replace1}
{docvariable replace2}
More text here......
I created a macro…

Norm
- 61
- 1
- 1
- 2
4
votes
3 answers
In vbscript can you use two possible conditions in an if statement? (OR)
An example would be:
If filter_purchase = 0 Or "" Then
SetDocVar "filter_purchase", "0"
Else
SetDocVar "filter_purchase", CStr(filter_purchase)
End If
But I get a 'Type Mismatch'. Would there be an easier way than doing Else IFs?

Michael Morgan
- 77
- 1
- 2
- 6
2
votes
1 answer
Updating DOCPROPERTY fields with GemBox
My document has DOCPROPERTY fields and I am trying to update them (Title, SubTitle, etc.).
Dim title As String = "New Title"
Dim subTitle As String = "New Sub Title"
Dim document =…

bellpatricia
- 39
- 10
1
vote
1 answer
Is there a way to show all docvariables from a word file?
I have a Microsoft-Word File which contains several DocVariables.
In our application we fill/replace these DocVariables with content.
With the shortcut Alt+F9 I can switch in a mode in which I can see the DocVariable.
But in the document I have now,…

DanEEStar
- 6,140
- 6
- 37
- 52
1
vote
0 answers
Is it possible to add or set DocVariable in Word document using Office.js API?
I have Word documents with fields like { DOCVARIABLE "508" }. Can I use Office.js API to add or set document variables ?

Patrick Beaulieu
- 11
- 1
0
votes
0 answers
How do I add author and year of pdf files as docvars in quanteda?
I have a set of 301 pdfs that I analyze using the tm and the quanteda package
With kwic I am looking for specific keywords
Ultimately, I would like to obtain a table with the following columns:
Author - Year - Keyword in Context
To my understanding,…

textgeek
- 1
- 1
0
votes
1 answer
Using a UserForm in VBA to update DocVariables in Word
I have created DocVariables in my word template, and am using a UserForm to allow user input to populate these variables.
Here is the code I have been using:
Private Sub CommandButton1_Click()
Dim ReportTitle, reportSub As String
ReportTitle =…

Tristan
- 13
- 3
0
votes
1 answer
Problems with MS Word DocVariables defined in VBA
Background: a proprietary piece of veterinary software generates a document pre-populated with merge fields containing data for a particular patient.
The field I am interested in is weight but its a string (Top_Stat) that looks like this "24.5…

Martin McDowell
- 3
- 1
0
votes
0 answers
How can I populate a DocVariable with a string value using VBA when the DocVariable field is contained within a TextBox
I am populating values into DocVariable fields using Access VBA throughout documents. This part is mostly working. The only part that is not working is when the DocVariable fields are placed inside of textboxes.
Legend
a. DOC VARIABLE EXAMPLE:…

Joseph Cameron
- 1
- 2
0
votes
1 answer
Replacing strings with docvariables located within textboxes
I am replacing strings of text with automation with DocVariable fields. The only issues is when these strings, going forward I will referrer to as TAGS, is when the TAG is located within "TextBox" Controls.
I use two modules to replace tags with…

Joseph Cameron
- 1
- 2
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…

Ilan_Schindler
- 11
- 4
0
votes
0 answers
Speeding up VBA code for adding fields to Word Document. Maybe using Virtual Offscreen Objects?
Is there a way to prepare a virtual object in Word using vba? I am trying to speed up adding about 20000+ Document Variables into the body of a document using the Fields.Add method.
Selection.Fields.Add Range:=Selection.Range, _
…

LanceDango
- 23
- 1
- 7
0
votes
1 answer
Userform in Word to change variables
I am trying to automate a Word file with a userform.
I was thinking to have some variables in the Word file and to put a button in the ribbon that opens a userform to input these values.
I followed some tutorial I found online and I have the…

Davide Galloni
- 3
- 2
0
votes
0 answers
How to add docvars to a corpus from another data frame object in r
I started using R very recently and this is my first post here. I'm still trying to get the hang of things.
Problem:
I have a text corpus (corpus1) created to do text analytics using quanteda (primarily). I've also created a docvar (filename) in the…

Asif Huq
- 1