Hi All,

I'm having a hard time breaking through this barrier. I need to iteratively
go through the word documnet and pull each line individually from beginning
to end. Right now I'm just trying to write each line of text to the
debugger just to see if it'll work.

I'd really appreciate an example or some helpful pointers.

Thanks,

Zac

Re: Return line of text iteratively by JGM

JGM
Fri Dec 05 21:40:56 CST 2003

Hi Zac,

Try something like:

Dim MyRange As Range
Dim MyDoc As Document
Dim AtEnd As Boolean

AtEnd = False

Set MyDoc = ActiveDocument

Selection.HomeKey wdStory

Do While Not AtEnd
Set MyRange = MyDoc.Bookmarks("\Line").Range
If MyRange.End + 1 = MyDoc.Range.End Then AtEnd = True
'Do someting with the line, like:
MyRange.Bold = True
If AtEnd Then Exit Sub
Selection.HomeKey wdLine
Selection.MoveDown wdLine, 1
Loop

HTH
Cheers!

--
_______________________________________
Jean-Guy Marcil
jmarcil@sympatico.ca

"Zac Hamilton" <woodmolding@hotmail.com> a écrit dans le message de news:
O26MFY5uDHA.2448@TK2MSFTNGP12.phx.gbl...
> Hi All,
>
> I'm having a hard time breaking through this barrier. I need to
iteratively
> go through the word documnet and pull each line individually from
beginning
> to end. Right now I'm just trying to write each line of text to the
> debugger just to see if it'll work.
>
> I'd really appreciate an example or some helpful pointers.
>
> Thanks,
>
> Zac
>
>
>
>



Re: Return line of text iteratively by Zac

Zac
Sat Dec 06 15:40:46 CST 2003

Great thx! Works perfectly

-Zac

"JGM" <no-spam@leaveme.alone> wrote in message
news:eoisjn6uDHA.2432@TK2MSFTNGP10.phx.gbl...
> Hi Zac,
>
> Try something like:
>
> Dim MyRange As Range
> Dim MyDoc As Document
> Dim AtEnd As Boolean
>
> AtEnd = False
>
> Set MyDoc = ActiveDocument
>
> Selection.HomeKey wdStory
>
> Do While Not AtEnd
> Set MyRange = MyDoc.Bookmarks("\Line").Range
> If MyRange.End + 1 = MyDoc.Range.End Then AtEnd = True
> 'Do someting with the line, like:
> MyRange.Bold = True
> If AtEnd Then Exit Sub
> Selection.HomeKey wdLine
> Selection.MoveDown wdLine, 1
> Loop
>
> HTH
> Cheers!
>
> --
> _______________________________________
> Jean-Guy Marcil
> jmarcil@sympatico.ca
>
> "Zac Hamilton" <woodmolding@hotmail.com> a écrit dans le message de news:
> O26MFY5uDHA.2448@TK2MSFTNGP12.phx.gbl...
> > Hi All,
> >
> > I'm having a hard time breaking through this barrier. I need to
> iteratively
> > go through the word documnet and pull each line individually from
> beginning
> > to end. Right now I'm just trying to write each line of text to the
> > debugger just to see if it'll work.
> >
> > I'd really appreciate an example or some helpful pointers.
> >
> > Thanks,
> >
> > Zac
> >
> >
> >
> >
>
>