Chinese characters in the message box of macros are displayed as question marks ???

The word document is available at http://isisdemo.nsfc.gov.cn/miniiris/news.asp , or http://isisdemo.nsfc.gov.cn/miniiris/proposal/NSFCProposal2013.exe .
(Unfortunately it is a nasty executable that generates a word document and several dll and other stuff, but they are 100% safe. since it is officially provided by the National Natural Science Foundation of China (NSFC))

It requires office 2003/2007 to open, and you will have to allow macro to fill some forms in it. For example, clicking on a button will show you a box, etc. However, the title and other texts on this box will be question marks!!! An example can be seen here: http://postimage.org/image/7yiofn8i3/

Note that the buttons themselves are properly displayed. Only the popup boxes go wrong.

My guess is that the macro sets the font for display manually, instead of let the Word finds a proper replacement.
However, the problem might be even more complicated.

Someone suggested adding all Chinese characters in a Chinese version of Windows (since everything works fine on a Windows OS in Chinese), but that hasn't solved the problem for me.

Of course this problem is probably very hard to solve, but will anyone give me some tip what this might be resulted from? A lot of appreciation here!!!

--Juno
 

Question Info


Last updated November 9, 2018 Views 2,803 Applies to:
I found the answer here:
http://social.msdn.microsoft.com/Forums/en-AU/vsto/thread/1257e55f-0002-41a7-853a-2bd95d28e2f0

[quote]
The VBA MSGBOX macro is not Unicode compliant from my memory and as such will have to use the Windows API to call the MessageBox methods that do support Unicode.
[/quote]

I've seen in the code that the strings comes directly from the VBA module, maybe the code below could be helpful.

BTW, the EXE file is a packed file, the NSFCproposal2013.doc could be extracted from that file without execute the EXE file. And the password for the DOC file is... well, that remains my secret. ;-)

Andreas.


Option Explicit

Private Declare Function MessageBoxW Lib "user32" ( _
  ByVal hWnd As Long, ByVal lpText As String, _
  ByVal lpCaption As String, ByVal wType As Long) As Long

Private Declare Function MessageBoxA Lib "user32" ( _
  ByVal hWnd As Long, ByVal lpText As String, _
  ByVal lpCaption As String, ByVal wType As Long) As Long
 
Function MsgBoxW(ByVal Prompt As String, _
    Optional ByVal Buttons As VbMsgBoxStyle = vbOKOnly, _
    Optional ByVal Title As String = "") As VbMsgBoxResult
  'Prompt = StrConv(Prompt, vbUnicode)
  'Title = StrConv(Title, vbUnicode)
  MessageBoxW 0&, Prompt, Title, Buttons
End Function
 
Function MsgBoxA(ByVal Prompt As String, _
    Optional ByVal Buttons As VbMsgBoxStyle = vbOKOnly, _
    Optional ByVal Title As String = "") As VbMsgBoxResult
  MessageBoxA 0&, Prompt, Title, Buttons
End Function
 
Sub Test()
  If MsgBoxA("ÒÔĬÈÏ·½Ê½´òÓ¡µ±Ç°Îĵµ", _
      vbYesNo + vbQuestion, "Title") = vbYes Then
    MsgBoxA "Yes"
  Else
    MsgBoxA "No"
  End If
End Sub

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Andreas, You are the boss! The answer looks very promising!!!

But I don't know much about VBA (but I did figured out the password for the macro "project"?)
For example, how can I edit the codes like what you posted (I only see a "project-like" side panel showing a lot of objects and properties that I can modify but not lines of codes). And, in the example you gave, what is the "windows api" of the vba msgbox?

A lot of appreciation and admiration here!!!

Cheers,
Ju

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Have a look at this tutorial, especially the part Writing Visual Basic macros in Excel:
http://www.wiseowl.co.uk/blog/s161/online-excel-vba-training.htm

Then you should be able to find the code modules.
Insert another module and paste in my code from above.
Search the other code modules for "MsgBox" and replace them with "MsgBoxA" or "MsgBoxW".

I don't know if that works, just a try.

Andreas.

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Thank you Andreas.

I went into the codes, and it turned out that the MsgBox set in the project actually works fine.
The problem is that they might have converted some oject (ISIS_Proposal.TDocument) in a dll file. So it seems impossible to move on (unless I magically learn to crack the dll file).

I already appreciate your tips!!

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.


I went into the codes, and it turned out that the MsgBox set in the project actually works fine.

If that works, can you please mark my first post as answer? So it's easier for others to find a solution for that problem. Thanks.

Andreas.

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.