Bookmark.Scripts Özellik
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
public Microsoft.Office.Core.Scripts Scripts { get; }
Özellik Değeri
ScriptsDENETIMDEKI HTML betikleri koleksiyonunu temsil eden bir koleksiyon Bookmark .
Örnekler
Aşağıdaki kod örneği ilk paragrafa bir komut dosyası ekler ve ardından Bookmark ilk paragrafa bir denetim ekler. Daha sonra kod, bir ileti kutusunda yer işaretinin içerdiği betiklerin sayısını görüntüler.
Bu örnek, belge düzeyinde özelleştirme içindir
private void BookmarkScripts()
{
Word.Range scriptRange = Paragraphs[1].Range;
Office.Script myScript = this.Scripts.Add(scriptRange, Microsoft.Office.Core.MsoScriptLocation.msoScriptLocationInBody,
Microsoft.Office.Core.MsoScriptLanguage.msoScriptLanguageVisualBasic, "Script ID", "Extended", "Script Text");
Microsoft.Office.Tools.Word.Bookmark bookmark1 =
this.Controls.AddBookmark(Paragraphs[1].Range, "bookmark1");
MessageBox.Show("Number of scripts in bookmark1: " +
bookmark1.Scripts.Count.ToString());
}
Private Sub BookmarkScripts()
Dim scriptRange As Word.Range = Paragraphs(1).Range
Dim myScript As Office.Script = Me.Scripts.Add( _
scriptRange, Microsoft.Office.Core.MsoScriptLocation _
.msoScriptLocationInBody, Microsoft.Office.Core _
.MsoScriptLanguage.msoScriptLanguageVisualBasic, _
"Script ID", "Extended", "Script Text")
Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")
MessageBox.Show("Number of scripts in bookmark1: " & _
Bookmark1.Scripts.Count.ToString)
End Sub