Forum Discussion

Mandy3000's avatar
Mandy3000
Copper Contributor
Sep 05, 2024

Assigning templates to many users via VBA scripting

I am assisting our Word developer assigning a specifc template/macro on the ribbon bar.  She secures it using specific usernames per the below.

Are there any other options than assigning individual AD accounts per below.  I may have about 20 people out of 1800 that use this template. 

thoughts?  Many thanks

 

Public Sub HWLE_Qantas_Templates(control As IRibbonControl)

    'Declare variable

    Dim strUserName As String

    'Get system logged in user name

    strUserName = VBA.Environ("Username")

    'Display the user name on sheet1

    If strUserName = "nmccombe" Or strUserName = "mglover" Or strUserName = "mcaplehorn" Or strUserName = "ajolly" Then

        Load frm_Qantas

        frm_Qantas.Show

    Else

            MsgBox "You do not have access to the Qantas Templates.", vbExclamation, Title:="Restricted Access"

        Exit Sub

 

    End If

End Sub

No RepliesBe the first to reply

Resources