Cindy
Thu Jun 24 13:44:51 CDT 2004
Hi Ed,
Your objFiles object would correspond to a Word.Document. And that doesn't
have a Paragraph property.
You'll find it helpful to declare object variables as Word. objects while
developing. If you need to use late-binding, change these to an Object
declaration once you're finished (except for the final testing, of course).
> Set objPar = objFiles.Paragraph
Set objPar = objFiles.RANGE.Paragraphs(1)
But from your title, I suspect what you're really looking for is
For each objpar in objFiles.Paragraphs
> I'm having trouble getting a VB6 app to iterate the paragraphs in a Word
> doc. It opens the doc fine , but every way I've tried to set an object to
> Paragraphs is rejected. Migth someone be able to help?
>
> Ed
>
> Dim objWord As Object
> Dim objFiles As Object
> Dim objPar As Object
> Dim rngPar As Object
> Dim docFiles As String
> Dim strFile As String
> Dim strDest As String
> Dim strHere As String
>
> strDest = "C:\Documents and Settings\emillis\Desktop\XCopy\"
>
> Set objWord = CreateObject("Word.Application")
>
> docFiles = "C:\Documents and Settings\emillis\Desktop\XCopy\TestDoc.doc"
> Set objFiles = objWord.Documents.Open(docFiles)
>
> 'Error here
> Set objPar = objFiles.Paragraph
>
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)