PDA

View Full Version : Formatting first line in a word doc



dinotom
06-03-2011, 08:09 AM
How do you capture the range object for the first line in a word document?

Thanks in advance!

macropod
06-03-2011, 03:20 PM
Lines in Word are a slippery thing. What consitutes a line on one PC may be different than for the same document on another PC - all due to the use of different printer drivers.

If your 'line' is actually a paragraph, then the code to work with the first paragraph would be something like:
With ActiveDocument.Paragraphs.First
'do stuff here
End With