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

how to get Horizontal line char in MS Word

Status
Not open for further replies.

NBartomeli

Programmer
Jul 1, 2003
111
US
I am trying to parse a work document, and get the first 3 characters at the beginning of the line right after every horizontal line in the document, but I am having trouble knowing what character to search for, or if i would be able to find them through the Document or Word objects

thanks in advance for any advice

-Nick
 
This code, in a blank worksheet in the "sheet1" window, will produce a list af all ASCII characters...
I suspect you'll want to key in on either
Chr(150)
or Chr(151)
(In other words, use these descriptives as the search criteria instead of (x = "-") or something like that.)


Private Sub Worksheet_Activate()
Dim i As Integer

For i = 1 To 255
Sheet1.Cells(i, 1) = Chr(i)
Next

End Sub

-Shrubble
 
Thanks for the help, but I was asking about WORD and now EXCEL

-Nick
 
Hi NBartomeli,

What do you mean by horizontal line? Do you mean a particular character, or a drawn line, or a line which is part of the formatting (after a paragraph for example). Each would need treating differently.

Depending on the answer, it might also be necessary to know what do you mean by beginning of the line because text in Word is not organized in lines - it flows depending on the margins.

Enjoy,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top