Skip to content

Latest commit

 

History

History
63 lines (38 loc) · 1.3 KB

Word.Document.DataForm.md

File metadata and controls

63 lines (38 loc) · 1.3 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Document.DataForm method (Word)
vbawd10.chm158007402
vbawd10.chm158007402
Word.Document.DataForm
138f8b31-f076-8573-510f-0295fb612226
06/08/2017
medium

Document.DataForm method (Word)

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

Syntax

expression. DataForm

expression Required. A variable that represents a Document object.

Remarks

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.

Example

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

See also

Document Object

[!includeSupport and feedback]