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

Help with Word 2K VBA

Status
Not open for further replies.

logius

Programmer
Aug 30, 2001
175
US
Greetings all,

I need some help with a routine I'm trying to write in Word 2000 VBA. What I need is code that will go through a newly created document and add a ` to the beginning of each line. I thought it would be easy but I'm trying to incorporate it into an existing routine. The main issue is that the third line isn't getting the characater. Someone care to help out? Here's the routine:
Code:
    Selection.HomeKey Unit:=wdStory
    Selection.HomeKey Unit:=wdLine
    Selection.TypeText Text:="`"
    
    For x = 1 To LoopVar
        Selection.MoveDown Unit:=wdLine
        Selection.HomeKey Unit:=wdLine
        Selection.TypeText Text:="`"
        If Resident = 0 Then
            Selection.HomeKey Unit:=wdLine
            Selection.MoveUntil Cset:=" ", Count:=23
            Selection.TypeText Text:=","
            Selection.TypeText Text:=""""
            Selection.EndKey Unit:=wdLine
            Selection.TypeText Text:=""""
        End If
   Next x
----------------------------------------
If you are reading this, then you have read too far... :p

lightwarrior@hotmail.com
 
Instead of "`" try Chr(96)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top