开发者

Outlook form region right to left from C++ code

开发者 https://www.devze.com 2023-03-31 16:07 出处:网络
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?

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

精彩评论

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