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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a GetLine function in VBA?

Status
Not open for further replies.

monak

MIS
Jul 2, 2002
22
US
I am trying to find equivalent so I can take lines from my ActiveDocument object and make a series of string comparisons?
 
if by 'lines' you mean paragraphs then you could use something like this

[tt]Dim oPara As Word.Paragraph

Set oPara = ActiveDocument.Paragraphs(3) ' get third paragraph
Debug.Print Left$(oPara.Range.Text, Len(oPara.Range.Text) - 1)
Set oPara = Nothing

Set oPara = ActiveDocument.Paragraphs(7) ' get seventh paragraph
Debug.Print Left$(oPara.Range.Text, Len(oPara.Range.Text) - 1)
Set oPara = Nothing[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top