ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Word .net open document

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?

0 Kudos
Message 1 of 12
(6,025 Views)

Have you tried using the "Application" constructor, not "ApplicationClass"?

0 Kudos
Message 2 of 12
(5,839 Views)

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" 

 

0 Kudos
Message 3 of 12
(5,821 Views)

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?

0 Kudos
Message 4 of 12
(5,780 Views)

Thanks for your suggestions,

I am working with LabVIEW 2014.

I haven't tried it with any earlier LabVIEW version.

0 Kudos
Message 5 of 12
(5,770 Views)

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

Message 6 of 12
(5,764 Views)

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.

 

0 Kudos
Message 7 of 12
(5,758 Views)

hello JO's:

 I have the same problem as you, have you solved the problem there?

0 Kudos
Message 8 of 12
(3,318 Views)

Hello Beck_Liang,  unfortunately not.  🙁  I haven't been looking into this for quite a while.  Would be good to have it working though.

0 Kudos
Message 9 of 12
(3,289 Views)

thanks for your feedback, I'm frantic about this issue... ...

0 Kudos
Message 10 of 12
(3,244 Views)