Freigeben über


Bookmark.Editors-Eigenschaft

Ruft ein Editors-Objekt ab, das alle Benutzer darstellt, die zum Ändern eines Bookmark-Steuerelements in einem Dokument autorisiert sind.

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

Syntax

'Declaration
ReadOnly Property Editors As Editors
Editors Editors { get; }

Eigenschaftswert

Typ: Microsoft.Office.Interop.Word.Editors
Ein Editors-Objekt, das alle Benutzer darstellt, die zum Ändern eines Bookmark-Steuerelements in einem Dokument autorisiert sind.

Beispiele

Im folgenden Codebeispiel wird dem ersten Absatz im Dokument ein Bookmark-Steuerelement mit Text hinzugefügt. Außerdem werden alle Benutzer als Editoren des vierten Worts im Lesezeichen hinzugefügt. Das Dokument ist dann gegen Überarbeitungen geschützt, und der editierbare Bereich des Lesezeichens wird in einem Meldungsfeld angezeigt.

Dieses Beispiel bezieht sich auf eine Anpassung auf Dokumentebene.

Private Sub BookmarkEditors()

    Dim editor As Object = Word.WdEditorType.wdEditorEveryone
    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")

    Bookmark1.Text = "This text cannot be edited."
    Bookmark1.Words(4).Editors.Add(editor)
    Me.Protect(Word.WdProtectionType.wdAllowOnlyReading)

    Dim range1 As Word.Range = Bookmark1.GoToEditableRange(editor)

    If Not (range1 Is Nothing) Then
        MessageBox.Show("The editable Range of Bookmark1 spans from " _
            & range1.Start.ToString & " to " & range1.End.ToString)
    End If

End Sub
private void BookmarkEditors()
{
    object editor = Word.WdEditorType.wdEditorEveryone;
    this.Paragraphs[1].Range.InsertParagraphBefore();
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    bookmark1.Text = "This text cannot be edited.";
    bookmark1.Words[4].Editors.Add(ref editor);
    this.Protect(Word.WdProtectionType.wdAllowOnlyReading,
        ref missing, ref missing, ref missing, ref missing);

    Word.Range range1 = bookmark1.GoToEditableRange(ref editor);

    if (range1 != null)
    {
        MessageBox.Show("The editable Range of bookmark1 spans from " +
            range1.Start.ToString() + " to " + range1.End.ToString());
    }
}

.NET Framework-Sicherheit

Siehe auch

Referenz

Bookmark Schnittstelle

Microsoft.Office.Tools.Word-Namespace