LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I open a word document from a url?

Solved!
Go to solution

We have a document server and I need to open a MSWord document that is a template for LabView to populate (using bookmarks and Connectivity Toolkit).

 

I have looked at the URL builder and I can't get that to work.  The Get Document does open the document but it doesn't seam to give the correct path to the Word Get Report so it doesn't give a good link.

 

I can open it in the default browser which links to Word but again there isn't any link to feed to Word Get Report.

 

Am I even close?

 

Thank you,

 

Ben

 

0 Kudos
Message 1 of 14
(13,381 Views)

Use a HTTP get, and store the file in a temporary location, then use this temp file as the template for the report generation toolkit.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 14
(13,365 Views)

I have tried using the Get HTTP.

 

http://Myserver.com/Mainfolder/MSWord.doc

 

This put in my web browser opens a word document, but when I put it in the Get HTTP, it gives me a 18401 Unauthorized.

 

I get a MSWord.doc out put on my desktop right where I say to put it but it is not the document from the server.  It is a page telling me I don't have authorization to view the document.

 

I have tried adding my LogIn:Password@ before the Myserver.com but that doesn't do any good either.

 

Is there any way to link a Open Word document to the Report Generation toolkit?  The Open URL in Default Browser does a great job of opening the file but it doesn't give me a "Path" that I can plug into the Report Gen.

 

Thank you,

Ben

0 Kudos
Message 3 of 14
(13,345 Views)

What happens if you initiliaze an HTTP session? With the init you can add a username and password.

 

The http://username:password@server trick only works for servers that allow you to use very bad protected authentication since the http call is not protected.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 4 of 14
(13,340 Views)

Hi,

 

please  try to use the attached VI which will run based on cmd line and let me know

 

 

0 Kudos
Message 5 of 14
(13,331 Views)

Sorry attachement missing

0 Kudos
Message 6 of 14
(13,328 Views)

I don't understand what the httpRequestID is.  How do I use the "Create Session.vi" to get a method of pointing to my document?

 

I can't use the command line because I don't have a path to the file.  If there is a way to convert the http into a path input I would be golden.

 

Thank you,

Ben

 

0 Kudos
Message 7 of 14
(13,319 Views)

Hi,

 

no issues. just copy your document url and paste in the path control and run the VI. i think it will work

0 Kudos
Message 8 of 14
(13,316 Views)

Ok, the Command line option does open the file, but it doesn't give me any link to tie into the Report Generation toolkit.  It is almost like the "Open URL in Default Browser.vi".

 

Is there a way to save this file after it is opened so that I can then point to that path?  Like a temp.doc on the desktop or something?

 

Thank you for the help,

 

Ben

0 Kudos
Message 9 of 14
(13,308 Views)
Solution
Accepted by Ben_7128

Here's a code snippet that should help you:

 

22186i00D8ED2A5A0855AE

 

It:

  • initializes a HTTP session with a username and password,
  • generates a random, non-existent filename with a doc extension
  • Get's a file on URL to the temporary filename
  • Closes the HTTP session
  • Starts the Report Generaton Toolkit, with the file from the web as the template

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 10 of 14
(13,298 Views)