I'm looking for some sort of way to be able to turn the mouse as pen feature on or off in the middle of an Impress presentation. The method of using right click and selecting from the menu is undesirable, I'd prefer to do it another way. Does this macro exist somewhere already? Should I write it instead?
If I do have to write it I have a couple of questions. Do I need to write it in the macro generator or would I write it in a separate program and then run that program externally? Do I do this by importing the UNO API into Eclipse? I'm totally confused how this works, thanks.
[Solved] Macro to switch "mouse as pen" in Impress
[Solved] Macro to switch "mouse as pen" in Impress
Last edited by Hagar Delest on Tue Mar 26, 2013 12:54 am, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
OpenOffice 3.1 on Windows Vista / NeoOffice 2.2.3 with MacOS 10.4 / OpenOffice 2.4 on Ubuntu 9.04
Re: Looking for a macro to switch "mouse as pen" in Impress
Hi,
Store this code into Basic library and assign it to key combination.
I wonder is there any way to change line width of pen through API.
Code: Select all
Sub SwitchToUsePen
oController = ThisComponent.getPresentation().getController()
If NOT IsNull( oController ) Then
b = NOT oController.UsePen
oController.UsePen = b
If b Then
oController.PenColor = RGB(0, 255, 0)
End If
End If
End Sub
I wonder is there any way to change line width of pen through API.
Edit: Unused line was removed. No API is there, simply the attribute PenWidth is not exported through the API. |
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
Apache OpenOffice 4-dev on Xubuntu 14.04
Re: Looking for a macro to switch "mouse as pen" in Impress
Thank you, that code worked great except in order to use it, I need to right click and select 'mouse as pen' to get the pen out. Then my keyboard shortcut (CTRL+h) for the macro works perfect. It switches the pen on and off with ease. However I do have to right click and select that option before it works. Is there another line of code to add in order to switch it on without having to do that?
OpenOffice 3.1 on Windows Vista / NeoOffice 2.2.3 with MacOS 10.4 / OpenOffice 2.4 on Ubuntu 9.04
Re: Looking for a macro to switch "mouse as pen" in Impress
I got it, I just needed to click the slideshow to select the window. For some reason the slideshow isn't the focused window when it starts, you need to click it first. Weird.
From searching around the internet before this, I suspect there will be quite a few people finding this thread in a search and benefiting from your code. Thanks!
From searching around the internet before this, I suspect there will be quite a few people finding this thread in a search and benefiting from your code. Thanks!
OpenOffice 3.1 on Windows Vista / NeoOffice 2.2.3 with MacOS 10.4 / OpenOffice 2.4 on Ubuntu 9.04