Hello all,
I'm using some coding to first, select from drop down form field in a word document based on a select case method.
My question is that in another part of the word document, i have a cross reference to this field and i want to know is how do i update this field using code.
The form field being referenced in the document is title DDNOC. There are two options as of right now. I need the reference field to update based on the value select here.
I'm using some coding to first, select from drop down form field in a word document based on a select case method.
My question is that in another part of the word document, i have a cross reference to this field and i want to know is how do i update this field using code.
VBA Code:
Dim Wordapp As Word.Application
Dim TPws As Worksheet
Set TPws = ThisWorkbook.Worksheets("Tract Parcels")
Dim wFile As String
wFile = ActiveWorkbook.Path & "\x.docx"
If Dir(wFile) <> "" Then
Wordapp.Documents.Open (wFile)
Wordapp.Visible = True
Else
MsgBox "File does not exists"
'do actions
End if
Select Case TPws.Cells(rw, "D")
Case "PVT AGR"
Wordapp.ActiveDocument.FormFields("DDNOC").DropDown.Value = 2
Case Else
Wordapp.ActiveDocument.FormFields("DDNOC").DropDown.Value = 1
End Select
The form field being referenced in the document is title DDNOC. There are two options as of right now. I need the reference field to update based on the value select here.