取消
显示结果 
搜索替代 
您的意思是: 

how to replace a word or line in a word document in CVI

I am trying to edit a word document using activeX in CVI. I want to search for a word and replace it with another. I couldn't find any functions which does the replace in wordreport.c. Could you please help me out?
0 项奖励
1 条消息(共 5 条)
3,352 次查看
This is the LabVIEW forum. You should post this in the CVI forum.
0 项奖励
2 条消息(共 5 条)
3,337 次查看

Hi Isn,

You will want to use the Microsoft Word 9.0 Object Library to interface with Microsoft Word.  You could then potentially be able to use the ActiveX calls provided to accomplish your goal.  The specifics on how to do this should be found in Microsoft's Documentation.

Refer to the Microsoft document entitled How to find and use Office object model documentation. In your case, you will be looking at the Vbawrd9.chm help file which I believe will be located in the C:\Program Files\Microsoft Office\OFFICE\1033\ directory.

Also refer to the Unable to Load Microsoft Excel/Word Help in LabWindows/CVI KnowledgeBase.

Derrick S.
Product Manager
NI DIAdem
National Instruments
0 项奖励
3 条消息(共 5 条)
3,324 次查看

Thank you Derrick.

Reg

Lakshmi

0 项奖励
4 条消息(共 5 条)
3,316 次查看
I found a very quick easy way to do a similar thing;
Save your document as an RTF file from wordpad (DOC does not work) with some unique tags where you need the text to be.
Open the document in as a binery file.
Find and replace the strings that you need.
Save a new copy of the document. It also works if you rename your document a DOC type file.
Done! This is so simple and fast compaired to the activeX method.
0 项奖励
5 条消息(共 5 条)
3,308 次查看