2007 ribbon download

  • Thread starter Thread starter Roy Lehmann
  • Start date Start date
R

Roy Lehmann

What XML do I need to enable running the onAction sequentially for the same
selected item?
 
Roy Lehmann said:
What XML do I need to enable running the onAction sequentially for the
same
selected item?

Hum, I not sure what your question means? What do you mean sequentially?

In most cases, if you want a button on the ribbon to run some VBA code, you
button xml will look like:

<button id="button1" label="Buttion1"
size="large"
onAction="=MyVBAFunction()"
/>



In the above, the onAction is set to =MyVBAFunction()

So, in your forms code module (or a standard code module), you declare the
above function like:


Public Function MyVBAFunction

.....code goes here


When you click on that button in the ribbon...the vba code will run.

The seems what your looking for, I just not sure about the term sequentially
and in what context you mean here?
 
<group id="tab01grp02" label="Run">
<dropDown id="ddnPrintReport" label="Report: "
supertip="Print Report"
getItemCount="ddnCount"
getItemLabel="ddnLabel"
getItemID="ddnID"
onAction="PrintReportSelect">
</dropDown>
</group>

What do I have to add to the above code to run the same item in the dropdown
list twice in a row?
 
Roy Lehmann said:
<group id="tab01grp02" label="Run">
<dropDown id="ddnPrintReport" label="Report: "
supertip="Print Report"
getItemCount="ddnCount"
getItemLabel="ddnLabel"
getItemID="ddnID"
onAction="PrintReportSelect">
</dropDown>
</group>

What do I have to add to the above code to run the same item in the
dropdown
list twice in a row?

In place of OnAction = PrintReportSelect, changet hat to

onAction="RunPrintReportSelec2t">


Then decleare a public function called

Public Function RunPrintReportSelec2t()

PrintReportSelect
PrintReportSelect

end function
 
Let me be clearer. What I want to do is run the report, do something else on
the same ribbon, and then come back to the dropdown list and run the same
report again.
 
Let me be clearer. What I want to do is run the report, do something else
on
the same ribbon, and then come back to the dropdown list and run the same
report again.

By do something else on the ribbon. Is the user doing that something else,
or it your code that supposed to do something else?

If it is code, then we run report, run that other code, and then run report
again.

It seems to me that your ribbon should then just pass the report name to a
function...and then that function can run the report....do whatever else it
was you are going to do, and then run the report again.


Public Function PrintReportSelect()

run report
do whatever that other function is
run report again

end end

It just not clear what that "other" something else is here. If this report
is to be run after selecting or using some other option on the ribbion, then
that fucntion will have to run the report again. In this case you might have
to resort to some global var that holds what report to run (or what report
was run).

Note that you can even stuff a string name into a var that represents a
function and go:

application.Run StringWithNameOfFunctionGoeshere

I think this much comes down to how the "other" option is to be
used/selected on the ribbon...
 
Let me be precise and then you can tell me that Microsoft, in its infinite
wisdom, does not allow it to happen. The dropDown option consists of a
laneled combo box. The combo box is a text box with a down arrow. Initially
the text box is blank. When you click on the down arrow, the dropdown list
is displayed. When you click on an item in the list, that item is selected,
its label is placed in the text box, and the onAction is run. After the
onAction completes, you cannot select or run the item displayed in the text
box although all other items in the dropdown list work normally. I was
hoping there was an easy way around this Microsoft limitation.
 
Back
Top