Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Using section access and want to take the username from the table created by the section access. Want to do that in the macro module and using if statement
example if vUsername='David' .... bla bla ...
Thanks in advance!
That`s how you can get the content.
set v = ActiveDocument.Variables("Variable1")
msgbox(v.GetContent.String)
If you use authenticated user that will probably be DOMAIN\USER (you can check that with the new macro).
After you set the value you can check it on the variable overview (settings menu)
Use this:
If you want the authenticated user (NTNAME on section access you use the first line
Use the second if you want to get the user name (when you use user name and password)
sub setUser
set v = ActiveDocument.GetVariable("vUser") v.SetContent ActiveDocument.GetLayout.AuthenticatedUser,true
' v.SetContent ActiveDocument.GetLayout.QvUser,true
end sub
I'm still having problems!
sub setUser
set vMacroUser = ActiveDocument.GetVariable("vUser")
vMacroUser .SetContent ActiveDocument.GetLayout.AuthenticatedUser,true
end sub
sub PlaySound
If vMacroUser = "????" Then
ActiveDocument.PlaySound "C:\WINDOWS\Media\tada.wav"
End If
it dont play the sound ! Don't know why ?! and could you please tell how to check what value has the variables in the macros
Thanks
That`s how you can get the content.
set v = ActiveDocument.Variables("Variable1")
msgbox(v.GetContent.String)
If you use authenticated user that will probably be DOMAIN\USER (you can check that with the new macro).
After you set the value you can check it on the variable overview (settings menu)