Hello All,
I have a button in Word via VBA that saves the Word document back to a SQL database.
Here is the button definition so far:
OnAction calls the functionSet oCommandBar = CommandBars.Add(Name:="Exp", Position:=msoBarTop) oCommandBar.Visible = True Set oMenue = oCommandBar.Controls.Add(Type:=msoControlButton) With oMenue .Caption = "Speichern nach Exp ..." .Style = msoButtonCaption .OnAction = "SendToExp" .Visible = True End With
This has also worked flawlessly for years. Now I wanted to add a second button that also saves back a PDF.Public Function SendToExp() As String Dim httpreq As MSXML2.XMLHTTP30 Dim Data As String Dim prop As DocumentProperty Dim url As String ........ End Function
Since I had to work on the macro anyway, I wanted to change the buttons to a modern ribbon UI.
New Ribbon UI XML
The button for the message box works:<customUI xmlns="Link office /2009/07/ customui"> <ribbon startFromScratch="false"> <tabs> <tab id="customTab" label="Justus Tab"> <group id="customGroup" label="Justus Group"> <button id="customButton" label="Exp1" imageMso="FileSave" size="normal" onAction="Messagebox" /> <button id="customButton2" label="Exp2" imageMso="FileSave" size="normal" onAction="SendToExp" /> </group> </tab> </tabs> </ribbon> </customUI>
When pressing the SendToExp button, an error occurs:Sub Messagebox(control As IRibbonControl) MsgBox("Hallo") End Sub
"Incorrect number of arguments or invalid assignment of a property".
Can someone tell me how the call must be directed?Public Function SendToExp(control As IRibbonControl) As String ...... End Function
Best thanks and many greetings
Markus



