Jump to content

Resuming Word Report


Recommended Posts

I am currently having problems opening a Microsoft Word document in LabView. I currently have "lab reports" on my computer that were created from a different LV program. I want to open these Word documents in Labview and "resume" these documents by appending a new report to them.

I haven't started programming the rest of the project, as I am currently stuck on how to open a microsoft word document in Labview to alter.

Any help would be appreciated!

Link to comment

I am currently having problems opening a Microsoft Word document in LabView. I currently have "lab reports" on my computer that were created from a different LV program. I want to open these Word documents in Labview and "resume" these documents by appending a new report to them.

I haven't started programming the rest of the project, as I am currently stuck on how to open a microsoft word document in Labview to alter.

Any help would be appreciated!

Take a look at

LabVIEW\vi.lib\platform\browser.llb\Open a Document on Disk.vi

This should help you.

Link to comment

Just as an update: I can finally open a previously saved document into my program, but can't seem to get it to append to anything (not sure how this is done). I can't use the "append report" vi's because the prior documents are not just text (they have graphs and tables).

I don't have access to LabView currently or I would attach what I have. Any suggestions on how to append multi-page reports to eachother would be much appreciated.

I have tried using Word Insert Object VI, but it seems as though it is appended as an object and only the first page of a report is appended.

Link to comment

Just as an update: I can finally open a previously saved document into my program, but can't seem to get it to append to anything (not sure how this is done). I can't use the "append report" vi's because the prior documents are not just text (they have graphs and tables).

I don't have access to LabView currently or I would attach what I have. Any suggestions on how to append multi-page reports to eachother would be much appreciated.

I have tried using Word Insert Object VI, but it seems as though it is appended as an object and only the first page of a report is appended.

Take a look at this post.

Link to comment

I had the same luck. I wasn't able to get multiple pages appended using Microsoft Insert Object vi. I did not quiet understand what the final post had mentioned stating "thinking of trying it with multiple 'Add Object' vi in concatenated way...".

I don't know either what Add Object in a concatenated way means or how it would be implemented.

I had a bit of a play and found a few things which should push you in the right direction. I don't think Add Object is going to be the way to go with this, I found that if you perform Insert -> Object from Word then you get the same result, just a single page. However if you do Insert -> File then you get what you want. So this then suggests the method that you need to implement. If you look inside Word Insert Object.vi then you see Method "AddOLEObject"

A path to investigate would be from the Document Ref get the Content Ref. On the Content Ref perform method "InsertFile"

I had a quick play with some partial success, but more tinker time was needed.

Link to comment

I don't know either what Add Object in a concatenated way means or how it would be implemented.

I had a bit of a play and found a few things which should push you in the right direction. I don't think Add Object is going to be the way to go with this, I found that if you perform Insert -> Object from Word then you get the same result, just a single page. However if you do Insert -> File then you get what you want. So this then suggests the method that you need to implement. If you look inside Word Insert Object.vi then you see Method "AddOLEObject"

A path to investigate would be from the Document Ref get the Content Ref. On the Content Ref perform method "InsertFile"

I had a quick play with some partial success, but more tinker time was needed.

SciWare, that looks indredibly promising. I just have a few questions regarding that method though. With the method "InsertFile", would you send the report you want appended into the Attachment of the InsertFile node? When I used the "Attachment" parameter, the output data was jumbled. I'm not sure if I mentioned this before, but the saved documents I'm trying to append to also has images and tables (not just text).

Edited by Question1
Link to comment

SciWare, that looks indredibly promising. I just have a few questions regarding that method though. With the method "InsertFile", would you send the report you want appended into the Attachment of the InsertFile node? When I used the "Attachment" parameter, the output data was jumbled. I'm not sure if I mentioned this before, but the saved documents I'm trying to append to also has images and tables (not just text).

I found some time to play with this again and came up with something that works.

Office.Word.InsertDoc.vi

This should get you going.

Link to comment

Thank you so much! This looks perfect. I'll test it out and let you know. Quick question. When I open the vi it states that the invoke node has a unwired/bad connection (The document open).

For some reason I keep getting the error code Error -2146823101 occurred at Exception occured in Microsoft Word: Word cannot insert a file into itself.

EDIT: Nevermind, the above occurs when you try to put the same document into itself.

EDIT2: Works PERFECTLY! Thank you so much!

Edited by Question1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.