Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.select

Status
Not open for further replies.

mickymoo

Programmer
Joined
Apr 4, 2002
Messages
23
Location
GB
I have written a mini-named entity recogniser in VBA for Word to search and find places in the assocaited word document. How do I transfer this to a stand alone VB 5 project? VB does not like document(1).select, is there a comparable way of doing it. How can I get my VB prject to open a word document, select the entire text and then scan it?

Any help appreciated


Micky
 
dim oDoc as Word.document

set odoc=getobject("C:\My documents\mine.doc")
odoc.select ' select entire doc or try odoc.range.select
odoc.range.find.Execute FindText:="hi", ReplaceWith:="hello", Replace:=wdReplaceAll ' do S & R
odoc.save
set odoc=nothing
 
Great thankyou,

word.document for W97 but what is the prefix if I want to use wordpad instead?



Michael
 
I don't think you can automate WordPad the same way (emphasis on I)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top