Jonathan
Wed Nov 16 08:52:37 CST 2005
This article will show you how to control Word from VB and open a document
by code.
Control Word from Excel
http://www.word.mvps.org/FAQs/InterDev/ControlWordFromXL.htm
Don't worry about the title - the principles & the code are pretty much
identical for VB6 and VBA. If you are using VB.NET you may have to adapt the
code somewhat as the language is different.
--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
"jbug_72" <jbug72@discussions.microsoft.com> wrote in message
news:365D39F4-D8C3-4C79-8B1B-FD2E36B5553F@microsoft.com...
> Sorry, I should've been more specific. The first thing I need to do is
> open
> (i.e. have access to the words...not open for the user to see) an existing
> Word document with Visual Basic. Do you know how to do this?
>
> "Tony Jollans" wrote:
>
>> You're not giving us much to go on here!
>>
>> It depends what you want to be able to extract from your document but a
>> starting point is probably Word's Collections of Paragrahs, Sentences,
>> Words, and/or Characters, for example ..
>>
>> Dim myWord As Range
>> For Each myWord In ActiveDocument.Words
>> Debug.Print myWord.Text
>> Next
>>
>> (obviously doing your own thing instead of debug.print)
>>
>> --
>> Enjoy,
>> Tony
>>
>>
>> "jbug_72" <jbug_72@discussions.microsoft.com> wrote in message
>> news:475B4474-D694-41EC-B526-D075A2D2C535@microsoft.com...
>> > I want to programatically parse a Word document and create a new Word
>> > document with the extracted data. I think creating a wizard/VB
>> application
>> > to do this would be ideal. As an alternative, I guess I could create a
>> > macro. Does anyone have some VB code that I could look at?
>>
>>
>>