Results 1 to 13 of 13

Thread: [RESOLVED] [Access] Hebrew letters in Msgbox()

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2017
    Posts
    7

    Resolved [RESOLVED] [Access] Hebrew letters in Msgbox()

    Hi,

    Is there any possibility to show Hebrew characters in a VBA Msgbox()

    Thanks for your help

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [Access] Hebrew letters in Msgbox()

    you should do a search for unicode messagebox, i am not sure if it would be a windows API call or a 3rd party control, but i am sure it would exist
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2017
    Posts
    7

    Re: [Access] Hebrew letters in Msgbox()

    Quote Originally Posted by westconn1 View Post
    you should do a search for unicode messagebox, i am not sure if it would be a windows API call or a 3rd party control, but i am sure it would exist
    Thanks for your reply.

    I found this:
    https://answers.microsoft.com/en-us/...6-95af5f29e324
    But i'm looking if there is something more simple.
    Last edited by VBA newbie; Feb 2nd, 2017 at 01:41 PM.

  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2017
    Posts
    7

    Re: [Access] Hebrew letters in Msgbox()


  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [Access] Hebrew letters in Msgbox()

    something more simple
    unless you can find something that has already been done by someone else, which they probably want to charge for, you are probably stuck with similar amounts of code

    you can probably just put the whole code into a module, which you can then just add to any project

    in your code, just call like
    MsgBoxW with the normal parameters for standard msgbox, no need to edit the code unless some issue like application.name will cause an error, you could easily change to app.exename or similar
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2017
    Posts
    7

    Re: [Access] Hebrew letters in Msgbox()

    Quote Originally Posted by westconn1 View Post
    in your code, just call like MsgBoxW with the normal parameters for standard msgbox
    I can't add the Hebrew text directly in the code, if yes i get the same question marks, what I did is to create a table with Hebrew strings, then declare a variable with dlookup to the specific string in the table, and using this variable for the prompt. still its a headache to add each time a string in the table instead directly in the code.

    BTW, how can I make that the message box should be RTL?

    Thanks

  7. #7
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [Access] Hebrew letters in Msgbox()

    there is no easy way for unicode in vba, you can use byte arrays to work with unicode strings, some years ago, i did an example with arabic, not very easy, and as i do not read arabic hard to know if the results were correct, the windows clipboard should also handle unicode correctly
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  8. #8

    Thread Starter
    New Member
    Join Date
    Jan 2017
    Posts
    7

    Re: [Access] Hebrew letters in Msgbox()

    And how about making the message box show up RTL?

  9. #9
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [Access] Hebrew letters in Msgbox()

    i am not sure there is any option available to do rtl with a vb6 /vba messagebox

    you could possibly use a vb.net class as an activex called from your VBA
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  10. #10

    Thread Starter
    New Member
    Join Date
    Jan 2017
    Posts
    7

    Re: [Access] Hebrew letters in Msgbox()

    Quote Originally Posted by westconn1 View Post
    i am not sure there is any option available to do rtl with a vb6 /vba messagebox
    I am not talking about the VB MsgBox(), my question is about the unicode message box function in the link above.

  11. #11
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [Access] Hebrew letters in Msgbox()

    my question is about the unicode message box function in the link above.
    as far as i can tell they are the same thing, just wrapped differently

    try adding the value of vbmsgboxrtlreading to the buttons, though i am not sure if it will work

    in the example from the link
    Code:
      Select Case MsgBoxW(Msg, vbYesNoCancel Or vbQuestion Or vbDefaultButton2 Or vbMsgBoxRtlReading)
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  12. #12

    Thread Starter
    New Member
    Join Date
    Jan 2017
    Posts
    7

    Re: [Access] Hebrew letters in Msgbox()

    Quote Originally Posted by westconn1 View Post
    as far as i can tell they are the same thing, just wrapped differently

    try adding the value of vbmsgboxrtlreading to the buttons, though i am not sure if it will work

    in the example from the link
    Code:
      Select Case MsgBoxW(Msg, vbYesNoCancel Or vbQuestion Or vbDefaultButton2 Or vbMsgBoxRtlReading)
    This worked just for the title not for the prompt. but by adding vbMsgBoxRtlReading + vbMsgBoxRight it got resolved, now everything is fine.

    Thanks for your great help!

  13. #13
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [RESOLVED] [Access] Hebrew letters in Msgbox()

    pls mark thread resolved
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width