Share via


Bookmark.LanguageID Property (2007 System)

Gets or sets the language for the Bookmark control.

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 LanguageID As WdLanguageID
'Usage
Dim instance As Bookmark 
Dim value As WdLanguageID 

value = instance.LanguageID

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

Property Value

Type: WdLanguageID
One of the WdLanguageID values.

Remarks

For a custom dictionary, you must first set the LanguageSpecific property to true before specifying the LanguageID property. Custom dictionaries that are language specific only look at text formatted for that language.

Examples

The following code example adds a Bookmark control to the document and then applies formatting to the bookmark based on the LanguageID of the text within the bookmark.

This example is for a document-level customization.

Private Sub BookmarkBiDi()
    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")

    If Bookmark1.LanguageID = Word.WdLanguageID.wdArabic OrElse _
        Bookmark1.LanguageID = Word.WdLanguageID.wdHebrew Then
        Bookmark1.BoldBi = True
        Bookmark1.ItalicBi = True 
    Else
        Bookmark1.Bold = True
        Bookmark1.Italic = True 
    End If 
End Sub
private void BookmarkBiDi()
{
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");

    int WordTrue = 1;
    if (bookmark1.LanguageID == Word.WdLanguageID.wdArabic || 
        bookmark1.LanguageID == Word.WdLanguageID.wdHebrew)
    {
        bookmark1.BoldBi = WordTrue;
        bookmark1.ItalicBi = WordTrue;
    }
    else
    {
        bookmark1.Bold = WordTrue;
        bookmark1.Italic = WordTrue;
    }
}

.NET Framework Security

See Also

Reference

Bookmark Class

Bookmark Members

Microsoft.Office.Tools.Word Namespace