FIGURE 6.5
Examining the Word MailMerge object in the Object Browser.Creating a New, Blank Word Document ........................................................
The NewDocfunction creates a new, blank Word document based on the default Word template:Public Function NewDoc()On Error GoTo ErrorHandlerDim appWord As Word.Application
Dim docs As Word.Documents
Dim doc As Word.DocumentSet appWord = GetObject(Class:=”Word.Application”)
Set docs = appWord.Documents
docs.Add
Set doc = appWord.ActiveDocumentErrorHandlerExit:
Exit FunctionPart II Writing VBA Code to Exchange Data between Office Components