VBA routine for selecting through a Word table?

Subject: VBA routine for selecting through a Word table?
From: "David Slonosky" <David_Slonosky -at- i2 -dot- com>
To: techwr-l -at- lists -dot- raycomm -dot- com
Date: Tue, 7 Sep 1999 11:57:47 -0400



I'm trying to write a routine that goes through a Word table selecting text and
stopping at the end of the current column. The following code isn't working. If
anyone has any suggestions, I'd be grateful.

Selection.MoveDown Unit:=wdLine, count:=1
Selection.HomeKey Unit:=wdLine
Selection.MoveRight Unit:=wdCharacter, count:=1, Extend:=wdExtend
If Selection.Text = "A" Then
ActiveDocument.Bookmarks.Add Name:="Placeholder"
Selection.MoveDown Unit:=wdLine, count:=1, Extend:=wdMove
Selection.MoveRight Unit:=wdCharacter, count:=2, Extend:=wdExtend
Do Until Selection.Type <> wdWithInTable
Selection.MoveDown Unit:=wdLine, count:=1, Extend:=wdExtend
Loop
Selection.MoveUp Unit:=wdLine, count:=1, Extend:=wdExtend
End If

David






Previous by Author: Re Who dreams up these things
Next by Author: Excel -> Access -> Word
Previous by Thread: RE: Platform-independed authoring tool
Next by Thread: Inserting Postscript commands into Word


What this post helpful? Share it with friends and colleagues:


Sponsored Ads