GetCaretPos (rel) returns 0,1 for OneNote?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Dick99999
Pro Scripter
Posts: 84
Joined: Thu Nov 27, 2008 10:25 am
Location: Netherlands

GetCaretPos (rel) returns 0,1 for OneNote?

Post by Dick99999 » Tue Oct 11, 2016 7:10 am

When I try to retrieve the relative caret position of OneNote, I always get 0,1. (Absolute returns the top left corner of the OneNote window.). Appreciate any help with the code below to make it working.

Code: Select all

SetFocus>OneNote:*
wait>0.5
GetCursorPos>nXPos,nYPos,csType
GetCaretPos>nXPosR,nYPosR,1
mdl>%nXPos%,%nYPos%,%nXPosR%,%nYPosR%
exit>1
EDIT: MS 14.3.02, Office 2016, Win 10

Dick99999
Pro Scripter
Posts: 84
Joined: Thu Nov 27, 2008 10:25 am
Location: Netherlands

Re: GetCaretPos (rel) returns 0,1 for OneNote?

Post by Dick99999 » Mon Oct 17, 2016 12:40 pm

I investigated this a little further. The getCaretPos works in word, excel, outlook and powerpoint, but not in oneNote. So it might be a Microsoft issue?

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: GetCaretPos (rel) returns 0,1 for OneNote?

Post by Marcus Tettmar » Mon Oct 17, 2016 1:43 pm

I'm afraid GetCaretPos won't work in all apps all the time. It's a case of suck it and see. Unfortunately it sounds like OneNote is one app you won't be able to use it in.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts