Hi,
at work, with Office 2002 and Windows XP
I see the same behaviour as you do.
However, at home, with Vista Small Business
and Office XP, the following code is working:
Option Explicit
' ---------------------------------------------
Public Declare Function GetCaretPos Lib "user32" _
(lpPoint As POINTAPI) As Long
Private Type POINTAPI ' 8 Bytes
x As Long
y As Long
End Type
Public Sub WhereAmI()
Dim p As POINTAPI
Dim l As Long
l = GetCaretPos(p)
ActiveDocument.Range.InsertAfter _
"(" & p.x & "," & p.y & ")"
MyStart
End Sub
Sub MyStart() ' for ongoing evaluation of caret position
Application.OnTime _
When:=Now + TimeValue("00:00:03"), _
name:="WhereamI"
End Sub
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Vista Small Business, Office XP