Insert Employee Contact Details into a Protected Word Booklet
Question details
Create a protected Word booklet that lets an employee select their name and add their contact details to the cover before printing.

- Product
- Microsoft Word and Microsoft Excel
- Device & OS
- not provided
- Scenario
- A shared booklet uses a maintained employee list to populate personalized cover details.
- Observed behavior
- The desired booklet preserves its protected layout while displaying the selected employee's name, phone number, email address, and website.
Use desktop Word and Excel with macros permitted by your organization's security policy. Create an Excel workbook with Name, Phone, Email, and Website in columns A–D of the first sheet, with employee records starting in row 2.
Use an Excel employee list and a Word UserForm
Use this approach when employees need to select a name in Word and populate a protected booklet cover from a centrally maintained list.
The example uses an unpassworded form-filling restriction so the macro can temporarily remove protection, update the cover, and restore protection. This restriction prevents ordinary editing but is not a security boundary.
The example requires desktop Word and Excel on Windows. Test it with a copy of the booklet and a small employee list before distributing the template.
In Word, enable Developer under File > Options > Customize Ribbon. On the cover, insert four Developer > Plain Text Content Control fields. Select each control, open Developer > Properties, and set its Tag to EmployeeName, Phone, Email, or Website, respectively.
Press Alt+F11, select the booklet project, and choose Insert > UserForm. Name the form frmEmployee. Add a ComboBox named cboEmployee and a CommandButton named cmdInsert; set the button caption to Insert details.
Double-click the form and paste the code below into its code window. Change the workbook path to the shared location of your employee list. The code reads the first worksheet and uses the four columns described above. Private Sub UserForm_Initialize() Dim xl As Object, wb As Object, ws As Object, r As Long On Error GoTo LoadError Set xl = CreateObject("Excel.Application") Set wb = xl.Workbooks.Open("C:\EmployeeData\Employees.xlsx", ReadOnly:=True) Set ws = wb.Worksheets(1) cboEmployee.ColumnCount = 4 cboEmployee.ColumnWidths = "150;0;0;0" r = 2 Do While Trim(CStr(ws.Cells(r, 1).Value)) <> "" cboEmployee.AddItem CStr(ws.Cells(r, 1).Value) cboEmployee.List(cboEmployee.ListCount - 1, 1) = CStr(ws.Cells(r, 2).Text) cboEmployee.List(cboEmployee.ListCount - 1, 2) = CStr(ws.Cells(r, 3).Text) cboEmployee.List(cboEmployee.ListCount - 1, 3) = CStr(ws.Cells(r, 4).Text) r = r + 1 Loop wb.Close False xl.Quit Exit Sub LoadError: On Error Resume Next If Not wb Is Nothing Then wb.Close False If Not xl Is Nothing Then xl.Quit MsgBox "Could not read the employee workbook. Check its path and access." End Sub Private Sub cmdInsert_Click() Dim doc As Document, tags As Variant, i As Long, wasProtected As Boolean If cboEmployee.ListIndex < 0 Then MsgBox "Select an employee first." Exit Sub End If Set doc = ActiveDocument If doc.ProtectionType <> wdNoProtection And doc.ProtectionType <> wdAllowOnlyFormFields Then MsgBox "This example requires form-filling protection or no protection." Exit Sub End If wasProtected = (doc.ProtectionType <> wdNoProtection) tags = Array("EmployeeName", "Phone", "Email", "Website") On Error GoTo UpdateError If wasProtected Then doc.Unprotect For i = 0 To 3 If doc.SelectContentControlsByTag(tags(i)).Count <> 1 Then Err.Raise 5 doc.SelectContentControlsByTag(tags(i))(1).Range.Text = cboEmployee.List(cboEmployee.ListIndex, i) Next i If wasProtected Then doc.Protect Type:=wdAllowOnlyFormFields, NoReset:=True Unload Me Exit Sub UpdateError: On Error Resume Next If wasProtected And doc.ProtectionType = wdNoProtection Then doc.Protect Type:=wdAllowOnlyFormFields, NoReset:=True MsgBox "Could not update the cover. Check the control tags and protection settings." End Sub
In the VBA editor, choose Insert > Module and paste: Public Sub SelectEmployee() frmEmployee.Show End Sub Return to Word and use File > Save As to save the booklet as a Word Macro-Enabled Template (.dotm).
In Word, open Developer > Restrict Editing, choose Filling in forms, and start enforcement without a password for this example. Save the template, create a new document from it, and run Developer > Macros > SelectEmployee. Select a name, click Insert details, verify the cover, and use File > Print.

Edit booklet documents with WPS Office
WPS Office is a free, lightweight alternative for editing booklet documents in a familiar interface. Open compatible Office files and continue working without a complicated migration; the Word-specific UserForm and protection workflow above still requires Microsoft Office.

Frequently Asked Questions
Where should I update an employee's contact details?
Edit the employee's row in the Excel workbook referenced by the UserForm, then save and close the workbook. The form reads the list again when it opens.
Why does the macro say it cannot read the employee workbook?
Check the path in the Workbooks.Open line and confirm that the user can access the file. The employee data must be on the first worksheet, with records starting in row 2.
Can I use a password to protect the booklet?
The example does not support password-protected editing restrictions. A password-aware macro would need a secure way to obtain the password; embedding it in VBA exposes it to users who can inspect the code.
Why are the cover details not being inserted?
In Developer > Properties, check that exactly one content control has each tag: EmployeeName, Phone, Email, and Website. Also check that the document is either unprotected or restricted to filling in forms.
Can I run the UserForm in Word for the web?
No. Open the macro-enabled template in desktop Word with macros permitted; Word for the web does not run VBA UserForms.




