I am a beginner in VBA and Office Ribbon UI. I am using Office 2007 and used Custom UI to develop a Ribbon in PPTM. I have added a set of XML like the one below:
<group id="myGroup" label="Hello World" visible="false">
<labelControl id="lblUsername" label="Your Username: " />
<labelControl id="lblFullname" label="" />
</group>
So, in this Hello World
tab, I would like to change its visibility to true
and change the the values of lblUsername
and lblFullname
. Currently this has to be done after the previous call by this button:
<button id="signin" label="Sign In" image="signin" size="large"
supertip="Click this button to sign in."
onAction="ribbon_SignIn" tag="SignIn" />
Right now the code in the ribbon_SignIn
is as follows:
Sub ribbon_SignIn()
SignIn.Show
End Sub
This opens the SignIn
form and gets the Username and Password from the user. After the username and password are validated, everything goes fine, but I am not sure what is the procedure to get the properties of controls lblUsername
and lblFullname
to change their values with the signed in user's details.
Clarification
In the SignIn
form I have the below code for the Sign In button.
Private Sub btnSignIn_Click()
' Authentication Mechanism
MsgBox "You have successfully signed in!"
' Show the Ribbon group.
' What am I supposed to do here to make the group visible?
' Also how do I change the text of the label?
End Sub
So, here what should I put to make the group visible? Also how do I change the text of the label?
Update #1
When I use the two attributes getVisible
and getLabel
in the Custom UI, the add-in itself is not getting displayed. :(
The code that I used was:
<group id="myGroup" label="Hello World" getVisible="VisibleGroup">
<labelControl id="lblUsername" label="Your Username: " getLabel="lblUsername" />
<labelControl id="lblFullname" label="" getLabel="lblFullname" />
</group>
If I remove those two attributes, Weird. BTW, I am using Office 2007.