Question1 Posted September 1, 2009 Report Share Posted September 1, 2009 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! Quote Link to comment
Kurt Friday Posted September 2, 2009 Report Share Posted September 2, 2009 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. Quote Link to comment
Question1 Posted September 2, 2009 Author Report Share Posted September 2, 2009 SciWare, thank you for the tip. I'm not sure if I can use this however. I need a VI that can send an opened Word Document or report into the Word Add New Document.vi for example. Quote Link to comment
Question1 Posted September 2, 2009 Author Report Share Posted September 2, 2009 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. Quote Link to comment
Kurt Friday Posted September 2, 2009 Report Share Posted September 2, 2009 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. Quote Link to comment
Question1 Posted September 2, 2009 Author Report Share Posted September 2, 2009 Take a look at this post. 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...". Quote Link to comment
Kurt Friday Posted September 3, 2009 Report Share Posted September 3, 2009 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. Quote Link to comment
Question1 Posted September 3, 2009 Author Report Share Posted September 3, 2009 (edited) 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 September 3, 2009 by Question1 Quote Link to comment
Kurt Friday Posted September 4, 2009 Report Share Posted September 4, 2009 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. Quote Link to comment
Question1 Posted September 4, 2009 Author Report Share Posted September 4, 2009 (edited) I found some time to play with this again and came up with something that works. This should get you going. Could you upload that in LV 8.5? Can't wait to try this. Edited September 4, 2009 by Question1 Quote Link to comment
Kurt Friday Posted September 4, 2009 Report Share Posted September 4, 2009 Could you upload that in LV 8.5? Can't wait to try this. No problem, try downloading it again its now in 8.5 Quote Link to comment
Question1 Posted September 4, 2009 Author Report Share Posted September 4, 2009 No problem, try downloading it again its now in 8.5 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). Quote Link to comment
Question1 Posted September 4, 2009 Author Report Share Posted September 4, 2009 (edited) 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 September 4, 2009 by Question1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.