Share via


Document.ClickAndTypeParagraphStyle Property (2007 System)

Gets or sets the default paragraph style applied to text by the Click and Type feature in the document.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public Property ClickAndTypeParagraphStyle As Object
'Usage
Dim instance As Document 
Dim value As Object 

value = instance.ClickAndTypeParagraphStyle

instance.ClickAndTypeParagraphStyle = value
[BrowsableAttribute(false)]
public Object ClickAndTypeParagraphStyle { get; set; }
[BrowsableAttribute(false)]
public:
property Object^ ClickAndTypeParagraphStyle {
    Object^ get ();
    void set (Object^ value);
}
public function get ClickAndTypeParagraphStyle () : Object 
public function set ClickAndTypeParagraphStyle (value : Object)

Property Value

Type: System.Object
The default paragraph style applied to text by the Click and Type feature in the document.

Remarks

To set this property, specify the local name of the style, an integer, a WdBuiltinStyle constant, or an object that represents the style.

If the InUse property for the specified style is set to false, an exception is thrown.

Examples

The following code example adds text to the first two paragraphs, styles the first paragraph as Plain Text, and then sets the ClickAndTypeParagraphStyle to Plain Text.

This example is for a document-level customization.

Private Sub DocumentClickAndTypeParagraphStyle()

    Dim styleName As Object = "Plain Text" 
    Me.Paragraphs(1).Range.InsertParagraphAfter()
    Me.Paragraphs(1).Range.InsertParagraphAfter()
    Me.Paragraphs(1).Range.Text = "This is sample text." 
    Me.Paragraphs(2).Range.Text = "This is sample text." 
    Me.Paragraphs(1).Range.Style = styleName

    If Me.Styles.Item(styleName).InUse Then 
        Me.ClickAndTypeParagraphStyle = styleName
    Else
        MessageBox.Show(styleName & " is not in use yet.")
    End If 

End Sub
private void DocumentClickAndTypeParagraphStyle()
{

    object styleName = "Plain Text";
    this.Paragraphs[1].Range.InsertParagraphAfter();
    this.Paragraphs[1].Range.InsertParagraphAfter();
    this.Paragraphs[1].Range.Text = "This is sample text.";
    this.Paragraphs[2].Range.Text = "This is sample text.";
    this.Paragraphs[1].Range.set_Style(ref styleName);

    if (this.Styles.get_Item(ref styleName).InUse)
    {
        this.ClickAndTypeParagraphStyle = styleName;
    }
    else
    {
        MessageBox.Show(styleName + " is not in use yet.");
    }
}

.NET Framework Security

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace