Hi Kushal,
see:
http://word.mvps.org/FAQs/MacrosVBA/GetColNoOfSelection.htm
And have a pretty close look at this one:
Sub GotoEndofColumn(c As Long, p As Long)
' c = target column
' p = target page
' x = which column is the insertion point in
' y = which page in the insertion point on
Dim x As Long
Dim y As Long
With selection
.Collapse
.ExtendMode = False
.GoTo _
what:=wdGoToPage, _
which:=wdGoToAbsolute, _
Count:=p
x = Dialogs(wdDialogFormatColumns).ColumnNo
y = .Information(wdActiveEndPageNumber)
While x <> c + 1
.MoveRight
x = Dialogs(wdDialogFormatColumns).ColumnNo
y = .Information(wdActiveEndPageNumber)
If y <> p Then
.MoveLeft
Exit Sub
End If
' test for end of doc
' where moveright doesn't move the selection any further
If .End = ActiveDocument.Content.End - 1 Then
Exit Sub
End If
Wend
.MoveLeft
End With
End Sub
Sub test889()
GotoEndofColumn 2, 6
End Sub
It seems, there is no other way than
moving the selection around a lot.
All together it is nothing but a workaround,
until someone comes up with a perfect solution.
The code is in no way bullet proof,
but may give you an idea on how to tackle the problem.
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"