Sdílet prostřednictvím


DocumentBase.ClickAndTypeParagraphStyle – vlastnost

Získá nebo nastaví výchozí styl odstavce aplikované na text klepnout a Typ funkce v dokumentu.

Obor názvů:  Microsoft.Office.Tools.Word
Sestavení:  Microsoft.Office.Tools.Word.v4.0.Utilities (v Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntaxe

'Deklarace
Public Property ClickAndTypeParagraphStyle As Object
    Get
    Set
public Object ClickAndTypeParagraphStyle { get; set; }

Hodnota vlastnosti

Typ: System.Object
Výchozí styl odstavce aplikované na text klepnout a Typ funkce v dokumentu.

Poznámky

Tuto vlastnostnastavit, určit místní název stylu integer WdBuiltinStyle konstanta, nebo objekt , představuje styl.

Pokud InUseurčený stylvlastnost nastavena na false, je vyvolána výjimka .

Příklady

Následující příklad kódu přidá text prvních dvou odstavců, styly jako prostý Text prvního odstavce a potom nastaví ClickAndTypeParagraphStyle na prostý Text. Chcete-li použít tento příklad spustit z ThisDocument třídy v projektu úrovni dokumentu.

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.");
    }
}

Zabezpečení rozhraní .NET Framework

Viz také

Odkaz

DocumentBase Třída

Microsoft.Office.Tools.Word – obor názvů