Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
I want to assign the QV variable value inside Macro and call the macro using button click.
Below is the coding I have used:
Sub Procedure
dim strValueToDisplay
set strValueToDisplay = ActiveDocument.Variables("V_AMID_Macro").GetContent().String
msgbox("The value of ""vValueToDisplay"" is: " & strValueToDisplay)
END Sub
But when I click the button it is taking to the edit module page instead of displaying the message box.
Please help to solve the issue.
Thanks.
Change it into:
Sub Procedure
dim strValueToDisplay
strValueToDisplay = ActiveDocument.Variables("V_AMID_Macro").GetContent.String
msgbox("The value of ""vValueToDisplay"" is: " & strValueToDisplay)
END Sub
- Marcus
Change it into:
Sub Procedure
dim strValueToDisplay
strValueToDisplay = ActiveDocument.Variables("V_AMID_Macro").GetContent.String
msgbox("The value of ""vValueToDisplay"" is: " & strValueToDisplay)
END Sub
- Marcus
Or try,
Sub Procedure
Set var = ActiveDocument.Variables("V_AMID_Macro")
MsgBox("The value of ""vValueToDisplay"" is: " & var.GetContent.String)
End Sub
Hi,
The message box expression should be
msgbox("The value of vValueToDisplay is: " & strValueToDisplay)
Is vValueToDisplay is a variable in macro? If yes also create a variable for this.
Check this link for more macro samples