Để xem được vĩ mô, mở các mô-đun Macros mới trong dự án vĩ mô đã được tạo ra. Xem Phụ lục ban hành kèm để tìm hiểu làm thế nào để mở VBE và xác định vị trí các mô-đun NewMacros. | Word Procedures Wrd End Sub End Sub End Variable declarationfl Dim frm As frmUserInputfl Dim doc As Set doc ActiveDocumentfl If 1 Thenfl MsgBox Invalide document. _fl No bookmarks could be found. _fl vbCritical vbOKOnlyfl Exit Subfl End Iffl Set frm New frmUserInputfl GetDataFromDocument frm docfl If OK Thenfl PutDataIntoDocument frm docfl End Iffl Unload frmfl If txtStartBody Thenfl txtStartBody . End Iffl Subfl fl GetDataFromDocument frm As UserForm doc As fl Variable declarationfl Dim ctl As Dim firstControl As Booleanfl For Each ctl In If Thenfl . If Not firstControl Thenfl 0fl Len fl firstControl Truefl Iffl End End Iffl Nextfl Subfl fl PutDataIntoDocument frm As UserForm doc As fl Variable declarationfl Dim ctl As Dim rng As For Each ctl In If Thenfl Set rng .Rangefl Name Range rngfl Iffl End Nextfl Subfl page 256 Office VBA Macros You Can Use Today Word Procedures Follow these steps 1. Copy the macro code to the correspondence template s VBA project. 2. Transfer the UserForm frmUserInput to the same project using either the Organizer or by dragging it in the Visual Basic Editor VBE to the template s project. The code for this UserForm module is below for reference. View the Appendix to learn how to store this procedure in a UserForm. Option explicitfl fl Private Sub btnCancel_Click fl Cancel fl End Subfl fl Private Sub btnOK_Click fl OK fl End Subfl The code in the example file also includes the basCreateBookmark module which is utilized in the Creating a Bookmark from a Selection entry found on page 260. It is