06-22-2016 06:42 AM
I've started work at interfacing Word using .NET
In LabVIEW: From the functions palette -> Connectivity -> .NET
I can open a reference to Microsoft.Office.Interop.Word.ApplicationClass which opens an instance of Word and can use property nodes, however I can't open a file programmatically through LabVIEW.
I've consulted https://msdn.microsoft.com/en-us/library/office/microsoft.office.interop.word.documents.open.aspx which details the parameters.
Whenever I run the code attached it produces error 1316 on the invoke node for documents.open, in fact whenever I call Word .NET methods through invoke nodes it generates this error code.
I've used the .NET interface tools before for LabVIEW to communicate with Excel and its Open method accepted a directly wired string for Filename, while this requires a System.Object reference.
I've already a working example in ActiveX and I just want to implement the functionality using the .NET approach.
I was wondering if anyone has any insight upon this?
07-17-2016 09:58 PM
Have you tried using the "Application" constructor, not "ApplicationClass"?
07-18-2016 03:53 AM
Hello pauldavey,
Thanks for replying.
To answer your question, if I try and select "Application" in the constructor node for the Word interop I get this in the "constructors" selection box:
"This class contains no public constructors"
07-18-2016 10:57 PM
I'm sorry I don't have any other suggestions except, what version of LabVIEW are you using, and have you tried under LabVIEW pre 2013 so it uses the CLR 2?
07-19-2016 02:43 AM
Thanks for your suggestions,
I am working with LabVIEW 2014.
I haven't tried it with any earlier LabVIEW version.
07-19-2016 04:12 AM - edited 07-19-2016 04:13 AM
Hey,
I was troubled with this issue in past using ActiveX APIs for EXCEL.
This example helped me to copy paste the open document method n the code
https://decibel.ni.com/content/docs/DOC-19187
07-19-2016 04:43 AM
Hello LVKrAkEn,
Thanks you for your input and attached example but I have mentioned that I can get LabVIEW interfacing Word through ActiveX already.
I also have LabVIEW interfacing Excel using the .net approach but for some reason can't replicate this success with Word.
I suspect that this may be an NI bug.
06-23-2022 01:00 AM
hello JO's:
I have the same problem as you, have you solved the problem there?
06-23-2022 04:27 AM
Hello Beck_Liang, unfortunately not. 🙁 I haven't been looking into this for quite a while. Would be good to have it working though.
07-05-2022 01:03 AM
thanks for your feedback, I'm frantic about this issue... ...