![]() |
#13
|
||||
|
||||
![]()
I don't understand why there needs to be multiple steps so my solution may not be what you wanted. I would approach this by making use of checkbox content controls and having a macro check the user logon name to determine how to expand the user details.
This approach then just expects the user to just check a box and then move their cursor in order to see their details replace the checkbox immediately. To me this is much simpler in terms of usability. I've attached a demo document showing how this is set up. The code that is being used in the file is Code:
Private Sub Document_ContentControlOnExit(ByVal aCC As ContentControl, Cancel As Boolean) Dim sUser As String, sID As String sID = Environ$("UserName") If aCC.Type = wdContentControlCheckBox Then If aCC.Checked Then sUser = ExpandUser(sID) If sUser <> "" Then aCC.Type = wdContentControlText aCC.MultiLine = True aCC.Range.Text = sUser End If End If End If End Sub Function ExpandUser(sID As String) As String Select Case sID Case "winki", "winkidelegate" ExpandUser = "V. d. strokovnega direktorja" & vbCr & "Valentina Winkler Skaza, dr. med., spec. psih." Case "mario123" ExpandUser = "Pomocnik direktorja za podrocje zdravstvene nege " & vbCr & "Mario Dremšak, mag. manag., dipl. zn." Case Else Application.StatusBar = "Not a recognised user: " & sID End Select End Function Sub ResetCheckBoxes() Dim aCC As ContentControl For Each aCC In ActiveDocument.SelectContentControlsByTag("Signed") aCC.Type = wdContentControlCheckBox aCC.Checked = False Next aCC End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Gerrit | Word VBA | 6 | 02-20-2021 08:53 AM |
![]() |
ksigcajun | Word VBA | 6 | 04-06-2015 07:41 AM |
Safe Senders Doesnt work | Anil Kaul | Outlook | 0 | 11-16-2012 01:28 PM |
![]() |
rmw85 | Word VBA | 1 | 04-25-2012 01:02 PM |
![]() |
dukquaknoobhack | Office | 1 | 01-05-2012 03:43 PM |