MailMergeFields.AddAsk Method

Adds an ASK field to a mail merge main document. Returns a MailMergeField object.

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

Syntax

'Declaration
Function AddAsk ( _
    Range As Range, _
    Name As String, _
    ByRef Prompt As Object, _
    ByRef DefaultAskText As Object, _
    ByRef AskOnce As Object _
) As MailMergeField
'Usage
Dim instance As MailMergeFields
Dim Range As Range
Dim Name As String
Dim Prompt As Object
Dim DefaultAskText As Object
Dim AskOnce As Object
Dim returnValue As MailMergeField

returnValue = instance.AddAsk(Range, Name, _
    Prompt, DefaultAskText, AskOnce)
MailMergeField AddAsk(
    Range Range,
    string Name,
    ref Object Prompt,
    ref Object DefaultAskText,
    ref Object AskOnce
)

Parameters

  • Name
    Type: System.String
    Required String. The bookmark name that the response or default text is assigned to. Use a REF field with the bookmark name to display the result in a document.
  • Prompt
    Type: System.Object%
    Optional Object. The text that's displayed in the dialog box.
  • DefaultAskText
    Type: System.Object%
    Optional Object. The default response, which appears in the text box when the dialog box is displayed. Corresponds to the \d switch for an ASK field.
  • AskOnce
    Type: System.Object%
    Optional Object. True to display the dialog box only once instead of each time a new data record is merged. Corresponds to the \o switch for an ASK field.

Return Value

Type: Microsoft.Office.Interop.Word.MailMergeField

Remarks

When updated, an ASK field displays a dialog box that prompts you for text to assign to the specified bookmark.

See Also

Reference

MailMergeFields Interface

MailMergeFields Members

Microsoft.Office.Interop.Word Namespace