10-22-2021 05:16 AM
Does anybody know, if it is possible to write from LabVIEW via ActiveX or the ReportGenerationToolkit to a Word - Control - Textbox.
I have attached a Screenshot from the Wordfile and the Word - Testdocument.
I can't find any Solution until now. I can't adress such a Textbox with a simple bookmark. It seems that this object type is a Microsoft Forms 2.0-textfield.
I assume, that I need to load Microsoft Forms 2.0 Object Library Version 2.0 for this Object Type.
But I have no idea how I can send some text from LabVIEW to such a TextBox, because I also have to open the document which I do with word_Application Reference.
It would be very helpful if anyone has an idea or a example - solution how it would work.
Thanks very much!
Solved! Go to Solution.
10-22-2021 03:24 PM
I'd look into the SendKeys.SendWait function of the System.Windows.Forms namespace. Look into that.
10-22-2021 04:52 PM
Yes. This is an annoying thing. Here's the issue:
Solution, browse for:
<Excel> --> C:\Program files\Microsoft Office\root\officeXX\EXCEL.EXE
<Word> --> C:\Program files\Microsoft Office\root\officeXX\MSWORD.OLD
10-25-2021 12:12 PM
I have now solved the described problem.
You have to search in the word document for InlineShapes (ActiveX Controls like Textboxes or Checkboxes are in a word document from Type InlineShape)
There you have to select OLEFormat where you get the classtype and the objectreference.
Then you have to convert the Variant - Object to the Class you need. In my case I have to Load Microsoft Forms 2.0 Object Library Version 2.0 and the Object TextBox (Forms.TextBox.1)
Then you can write to the TextBox.
I have attached my Example File (for LV20 and also for older LV15) if anyone else needs also a solution for this case.
Thanks anyway to everyone who has already replied and tried to help to find a solution!