LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to update fields in word

Solved!
Go to solution

Hi everybody,

Is there a way to update all the fields as explained here (Update a cross-reference from one page to another)

https://support.office.com/en-us/article/Create-or-update-a-cross-reference-aa35c606-34e8-4c64-b6eb-...

 

in order to update cross-references linked to bookmarks in a word template before closing it while appending some texts and pictures ?

I struggle to find a solution.

Cheers,

0 Kudos
Message 1 of 18
(4,147 Views)

Are you trying to do this thru Labview?  Or is this a Word question?  Bottom of the article says this applies to Word for Mac 2011.  Does this apply to your use case?

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 18
(4,126 Views)

I am trying to do this through Labview. Actually I am just looking for a way to update/refresh the entire word (fields, cross-reference etc) before closing it. I do not know if it feasible using a Active X command or something else....

0 Kudos
Message 3 of 18
(4,114 Views)

Can you do this update routine in the software successfully (without Labview)?  If so, record a macro of your actions and use the macro code to determine the ActiveX objects that are needed to do it externally.  

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 18
(4,103 Views)

Is it possible to do a Ctrl+A and F9 with Labview in a word ?

 

Or to do this Macro

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
Dim J As Integer
Dim K As Integer
 
If ActiveDocument.Sections.Count > 2 Then
   For J = 3 To ActiveDocument.Sections.Count
      For K = 1 To ActiveDocument.Sections(J).Headers.Count
         ActiveDocument.Sections(J).Headers(K).Range.Fields.Update
      Next K
      For K = 1 To ActiveDocument.Sections(J).Footers.Count
         ActiveDocument.Sections(J).Footers(K).Range.Fields.Update
      Next K
   Next J
End If

 

with ActiveX

 

Or to do a print preview of the word (with the option updates fields selected in the options of Word) and then add some modification before saving and closing the documents ???

 

I am new with Labview and I really do not know how to do this...

0 Kudos
Message 5 of 18
(4,086 Views)
Solution
Accepted by topic author Neercs

This is just a start.  I don't have the For Loops from your macro but you can see how to get access to the necessary ActiveX objects.  

Example_VI_BD.png

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 6 of 18
(4,080 Views)

Thank you very much and sorry again but in which library do you all this class ? I just manage to find Fields-Update....

0 Kudos
Message 7 of 18
(4,070 Views)

I use the Report Generation toolkit as a jumping off point.  There is a VI there (2nd in the picture) that returns ActiveX references.  The picture I attached is a snippet.  Drag it to your desktop and then onto a block diagram and if you have the Report toolkit, everything will be added automatically to your VI.  

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 8 of 18
(4,064 Views)

Wow, I didn't know anything about this snippet ^^. I will save a lot of time now ^^. Thank you.

0 Kudos
Message 9 of 18
(4,052 Views)

If one of my responses sufficiently answers your question, please mark it as the solution so others that come along with a similar question can see how you solved it.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 10 of 18
(4,040 Views)