
Hi Faisal Khan8,
Thank you for reaching out to our community, I'm glad to be here to support you
Based on your description, you're trying to display correct Urdu text in a custom VBA notification form using the Arial (Arabic) font, but the output is incorrect. here is some suggestions may be helpful to you:
1. Set System Locale to Urdu
VBA is a non-Unicode environment, so the system locale must match the target language.
Steps:
- Go to Control Panel > Region > Administrative tab
- Click Change system locale
- Select Urdu (Pakistan) or Arabic (Pakistan) depending on the font
- Restart the computer
This change allows non-Unicode programs like VBA to render Urdu properly
2. Use a Compatible Font in VBA Editor
Even if Arial(Arabic) is selected, the VBA editor may not render Urdu unless the font fully supports it.
Recommended Fonts:
- Courier New (Arabic) or Times New Roman (Arabic) often work better
- Set this in VBA Editor > Tools > Options > Editor Format > Font
This workaround has been confirmed to allow correct Arabic and Urdu rendering in VBA code 3. Paste Urdu Text from UTF-8 Source Typing Urdu directly in the VBA editor may result in garbled characters. Instead:
- Write the Urdu message in Notepad and save it as UTF-8
- Copy and paste the text into your VBA code
Example:
MsgBox "آپ کا پیغام یہاں ہے", vbInformation, "اطلاع"
If this shows as "????", it’s likely due to encoding or font issues. Use the UTF-8 method to preserve characters
4. Use HTML or Unicode Workarounds for Forms
If the notification is displayed in a form or email, use HTML formatting with UTF-8 encoding:
Function UrduHTML(msg As String) As String
UrduHTML = ""
UrduHTML = UrduHTML & msg & ""
End Function
Then use this in your form or email body to ensure proper rendering
Kindly note:
- If Urdu still doesn’t show correctly, try changing the font to Courier New (Arabic) in the VBA editor
- Make sure the Windows language pack for Urdu is installed.
- Some users report RTL typing issues in VBA on macOS
Hope it helps, and pardon me if I misunderstand your point, If it's so, please provide us screenshot so we can better understand your issue. Please feel free to reach out if you need any other supporting.
Have a nice day
Best regards, Darren-Ng | Microsoft Community Support Specialist