Bookmark.ConvertHangulAndHanja Method (Object, Object, Object, Object, Object)

 

Converts the Bookmark control text from Hangul to Hanja or vice versa.

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

void ConvertHangulAndHanja(
	ref object ConversionsMode,
	ref object FastConversion,
	ref object CheckHangulEnding,
	ref object EnableRecentOrdering,
	ref object CustomDictionary
)

Parameters

ConversionsMode
Type: System.Object

Sets the direction for the conversion between Hangul and Hanja. Can be either of the following T:Microsoft.Office.Interop.Word.WdMultipleWordConversionsMode constants: F:Microsoft.Office.Interop.Word.WdMultipleWordConversionsMode.wdHangulToHanja or F:Microsoft.Office.Interop.Word.WdMultipleWordConversionsMode.wdHanjaToHangul. The default value is the current value of the P:Microsoft.Office.Interop.Word.Options.MultipleWordConversionsMode property.

FastConversion
Type: System.Object

true if Microsoft Office Word automatically converts a word with only one suggestion for conversion. The default value is the current value of the P:Microsoft.Office.Interop.Word.Options.HangulHanjaFastConversion property.

CheckHangulEnding
Type: System.Object

true if Word automatically detects Hangul endings and ignores them. The default value is the current value of the P:Microsoft.Office.Interop.Word.Options.CheckHangulEndings property. This argument is ignored if the ConversionsMode argument is set to F:Microsoft.Office.Interop.Word.WdMultipleWordConversionsMode.wdHanjaToHangul.

EnableRecentOrdering
Type: System.Object

true if Word displays the most recently used words at the top of the suggestions list. The default value is the current value of the P:Microsoft.Office.Interop.Word.Options.EnableHangulHanjaRecentOrdering property.

CustomDictionary
Type: System.Object

The name of a custom Hangul-Hanja conversion dictionary. Use this argument in order to use a custom dictionary with Hangul-Hanja conversions not contained in the main dictionary.

For information on optional parameters, see Optional Parameters in Office Solutions.

The following code example adds a Bookmark control to the first paragraph in the document, then checks if the LanguageID of the bookmark is wdKorean. If so, it converts the bookmark from Hangul to Hanja or vice versa.

This example is for a document-level customization.

private void BookmarkConvertHangulAndHanja()
{
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");

    object ConversionsMode = Word.WdMultipleWordConversionsMode
        .wdHangulToHanja;
    object FastConversion = false;
    object CheckHangulEnding = true;
    object EnableRecentOrdering = true;
    object CustomDictionary = missing;

    if (bookmark1.LanguageID == Word.WdLanguageID.wdKorean)
    {
        bookmark1.ConvertHangulAndHanja(ref ConversionsMode,
            ref FastConversion, ref CheckHangulEnding, ref 
            EnableRecentOrdering, ref CustomDictionary);
    }
}
Return to top
Show: