, sau đó nhấp vào nút mới. Mẹo: Nếu bạn thực hiện một sai lầm, chỉ cần bắt đầu lại từ đầu. Ghi vĩ mô sẽ ghi đè lên các vĩ mô đầu tiên nếu bạn cho nó cùng vĩ mô tạo ra mã cho định dạng tất cả chín | Word Procedures Insert the data stringfl listfl Convert it to a tablefl Set tbl Separator sepChar NumColumns nrCols fl Restore the bookmark around the tablefl Range Name BookmarkNamefl FormatTable tblfl End Subfl fl Sub FormatTable tbl As fl Variable declarationfl Dim cel As Dim s As Stringfl Bold the header rowfl With 1 . Wrd .Bold Truefl .Underline wdUnderlineSinglefl End Withfl Center the last columnfl .Selectfl For Each cel In wdAlignParagraphCenterfl Next celfl Falsefl End Subfl fl Sub ActivateEvents fl Set End Subfl fl Sub DeactivateEvents fl Set MergeEvents Nothingfl End Subfl View the Appendix to learn how to store this procedure in a Class module. Option explicit fl Public WithEvents WdApp As Const sMergeMessage As String The merge process can take some time. _fl vbCr vbCr Word may pause and seem to hang while the charts update. _fl vbCr vbCr Please do NOT try to work _fl in Word until the finish message has been displayed fl Private rs As Office VBA Macros You Can Use Today page 211 Word Procedures Wrd Private Sub WdApp_MailMergeAfterMerge ByVal Doc As Document _fl ByVal DocResult As Document Release the datafl Set rs Nothingfl Delete the last table and restore the bookmarkfl If BookmarkName Thenfl Variable declarationfl Dim rng As Set rng BookmarkName .Rangefl If 0 Thenfl 1 .Deletefl End Iffl Range rng Name BookmarkNamefl End Iffl MsgBox Merge process has finished fl Display the merge result documentfl If Not DocResult Is Nothing Thenfl Falsefl End Iffl End Subfl fl Private Sub .