• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 12. Mail Merge Magic > What Happens When the Document Is Opened

What Happens When the Document Is Opened

The DynamicMailMerge.doc document contains the Document_Open procedure shown in Listing 12.2. This code belongs to the ThisDocument object seen in Figure 12.3.

Listing 12.2. This code runs when the document opens.

Private Sub Document_Open()
  ' break the connection to the merge data
  ' will be reconnected when running a query
  ActiveDocument.MailMerge.MainDocumentType = _
      wdNotAMergeDocument
  ' show Main Form
  frmMain.Show
End Sub


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint