Log in

View Full Version : [SOLVED:] Using VBA to add horizontal and vertical guides at the cursor position



isabelle r
03-21-2019, 06:18 AM
Hello all,

I'd need a macro in PPT to add a horizontal and vertical guide at the point where the cursor is placed on the screen. I've looked online, and I understand that there is a Guides.Add method which could help, but for the life of me I can't understand how to get the position of the cursor and incorporate that into Guides.Add.

Does anyone have an idea how I could do this in VBA?

Thank you,

-Isa

John Wilson
03-21-2019, 07:23 AM
There's no easy way to get the cursor position. You can though add a shape and a guide aligned with it's top and left. There's also the problem of running the macro without moving the cursor!

isabelle r
03-22-2019, 07:04 AM
There's no easy way to get the cursor position.

That's a shame. I looked around and found a couple of suggestions, but they seem not to work. Well, I'll just have to find another way.

Thanks for your help anyway.

-Isa

John Wilson
03-22-2019, 07:16 AM
Even if you could how would you run the macro?

isabelle r
03-22-2019, 07:27 AM
I was thinking about using a few seconds pause in the macro, which would allow me to place the cursor where I need it.

John Wilson
03-23-2019, 04:35 AM
Far easier to have a guide shape you drag to the correct position.