开发者

Outlook form region right to left from C++ code

How can I set a string to have Right-to-Left (U+200F RIGHT-TO-LEFT MARK (RLM)) unicode char when editing the code itself?

Meaning, I have the given code:

CComPtr<MSForms::IControl> spISubjectControl;
spControls->_GetItemByName(_bstr_t(L"Subject"), &spISubjectControl);
if (spISubjectControl != NULL) {
    CComPtr<Outlook::_OlkTextBox> spSubject;
    hr = spISubjectControl.QueryInterface(&spSubject);
    if (spSubject != NULL) {
        CString subject = L"Some words in some RTL language";
        spSubject->put_Text(_bstr_t(subject));
    }
}

Unfortunately it is not eno开发者_如何学编程ugh to add the direction and the special character in the "advance properties" of the subject TextBox, it seems that once I change the content of the TextBox the direction is reset to LTR.

Please help :)

Thanks,

Nili


Make sure that the subject string does contain the Unicode RLM character. Try with L"\u200F ‏Some words in some RTL language". If the \u200F escape sequence does not work, try \x200F instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜