Ask Your Question
1

How can I change a button when it's pressed?

asked 2019-07-11 01:12:54 +0200

Tomkun gravatar image

I am using Impress to create a quiz for my students. I have a grid of shapes which jump to another slide with a question on it when pressed. When the question is answered, it goes back to the grid screen. Imagine a "Jeopardy" board or something like that.

I would like to change the colour of the button after it has been pressed so that it's obvious to me and the students which questions have already been answered. I have been through many macro tutorials, but I cannot work it out.

Is this possible?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2019-07-11 12:39:12 +0200

I have done similar, only I have the button add a number to a cell, than use that cell to say something in another, with the IF and the CONCATENATE commands in a cell. The sub below I created by "Tools/Macros/record macro". then I called "Entered_1_in_a_cell_H_11" in the sub which was assign to the button. Good luck.

sub Entered_1_in_a_cell_H_11 rem define variables dim document as object dim dispatcher as object rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dim args1(0) as new com.sun.star.beans.PropertyValue args1(0).Name = "ToPoint"

args1(0).Value = "$H$11"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1()) dim** args2(0) as new com.sun.star.beans.PropertyValue args2(0).Name = "StringName" args2(0).Value = "1" dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args2()) dispatcher.executeDispatch(document, ".uno:JumpToNextCell", "", 0, Array()) end sub

edit flag offensive delete link more

Comments

I am using Impress rather than Calc for this. Is there a way to use your method in Impress?

Tomkun gravatar imageTomkun ( 2019-07-16 04:42:06 +0200 )edit

I am not sure if it will?

Mark McLean gravatar imageMark McLean ( 2019-07-16 12:03:09 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-07-11 01:12:54 +0200

Seen: 22 times

Last updated: Jul 11