LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with Word_DocumentSaveAs

I am using CVI 8.0, but alo had problems with 7.0 before.  What is with variants and Word_DocumentSaveAs.  At least I think that the problems is with variants, but I always seem to get an error when using this function.  Even using the sample program Word2000demo.cws that came with the 8.0 installation, the code frequently breaks at the line......
 
Error: 
   CA_VariantClear(&fileNameVt)  just after the the function Word_DocumentSaveAs(...) is called. The arguements going in seem ok.
 
This error is not always exactly repeatable, .. it seems to be influenced by how the Save As Dialog is manipulated (replace existing, new file name,... etc)
 
In addition, when closing the application, I sometimes get a message "a nondebugable thread is trying to suspend execution at address 00000001. Do you want to suspend execution?
 
This code is exactly as  was written by NI.  I made no changes. 
 
I am using word2003.  The comment at the top of the single source file says that it will work with Word 9.0 and later.
I am using WinXP SP2. 
 
Thanks for any help
bill
 

Message Edited by bglat on 04-13-2006 12:42 PM

0 Kudos
Message 1 of 3
(3,235 Views)

Hello,

 

Thank you for posting to the NI Discussion Forums.  I apologize that you are getting errors when running this example and the documentation for that example does not provide clear enough information for troubleshooting problems with the functionality.  However, though this example was created for Word 2000 there is absolutely no guarantee that the example will work for any other version of MS Word.  The reason for this is that the example was built on top of the ActiveX functions provided by Microsoft for that version of MS Word.  Microsoft frequently changes the supported ActiveX functionality with each version of product it releases (for example, WMP 10 has broken most of the ActiveX examples associated with media player).  A lot of times the functionality may change only slightly for main operations and so users will typically notice failures infrequently and with only specific functions.  I suspect that the problem you are experiencing is related.

 

If you can find a version of Word 2K lying around it might be helpful to test the example with that.  Also, you might want to include some additional information on what your application is trying to do; perhaps there are other users who have done the same thing with MS Word 2003.

 

I apologize that the word instrument driver is not completely compatible with this version of Word.  I understand that troubleshooting these problems can be difficult, but I have found a pretty good Microsoft document on how to find some useful ActiveX documentation: http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q222101&.

 

Please let us know how we can help-

Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 2 of 3
(3,214 Views)

I have a solution in that I used the NI activeX wizard to create a word 11 object module, ... just for the _Document stuff.  Then I replaced the call to documentSaveAs to MYNEWPREFIX_DocumentSaveAs2000 (...) This seemed to work, at least on two Dell machines.  I did have trouble on a Sony in that the bit maps that I had inserted into a Word table, did not come out, but I guess that this is a different issue.

Anyway, this is an old beef of mine in that NI doesn't have a good way to write a report without using ActiveX.  I maintain that the report is the whole purpose of collecting lab data.  It is the way to make sense of the data and share  it with others.  It's what my boss sees.  He doesn't see code, he sees the report.  I wish NI would make this a higher priority,... who wants to be at the whim of Microsoft?

thanks

0 Kudos
Message 3 of 3
(3,212 Views)