Skip to content

Latest commit

 

History

History
55 lines (33 loc) · 1.25 KB

Word.MailMerge.EditMainDocument.md

File metadata and controls

55 lines (33 loc) · 1.25 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
MailMerge.EditMainDocument method (Word)
vbawd10.chm153092205
vbawd10.chm153092205
Word.MailMerge.EditMainDocument
06ef9288-9434-7e75-ca6c-75c21fffd6b4
06/08/2017
medium

MailMerge.EditMainDocument method (Word)

Activates the mail merge main document associated with the specified header source or data source document.

Syntax

expression. EditMainDocument

expression Required. A variable that represents a 'MailMerge' object.

Remarks

If the main document isn't open, an error occurs. Use the Open method if the main document isn't currently open.

Example

This example attempts to activate the main document associated with the active data source document. If the main document isn't open, the Open dialog box is displayed, with a message in the status bar.

Sub ActivateMain() 
 On Error GoTo errorhandler 
 Documents("Data.doc").MailMerge.EditMainDocument 
 
 Exit Sub 
 
errorhandler: 
 If Err = 4605 Then StatusBar = "Main document is not open" 
 Dialogs(wdDialogFileOpen).Show 
End Sub

See also

MailMerge Object

[!includeSupport and feedback]