Export (0) Print
Expand All
Expand Minimize

Document.DataForm Method (Word)

Published: July 16, 2012

Displays the Data Form dialog box, in which you can add, delete, or modify records.

expression .DataForm

expression Required. A variable that represents a Document object.

You can use this method with a mail merge main document, a mail merge data source, or any document that contains data delimited by table cells or separator characters.

This example displays the Data Form dialog box if the active document is a mail merge document.

If ActiveDocument.MailMerge.State <> wdNormalDocument Then 
 ActiveDocument.DataForm 
End If

This example creates a table in a new document and then displays the Data Form dialog box.

Set aDoc = Documents.Add 
With aDoc 
 .Tables.Add Range:=aDoc.Content, NumRows:=2, NumColumns:=2 
 .Tables(1).Cell(1, 1).Range.Text = "Name" 
 .Tables(1).Cell(1, 2).Range.Text = "Age" 
 .DataForm 
End With

Community Additions

ADD
Show:
© 2014 Microsoft