Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 70285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:42:25+00:00 2026-05-10T19:42:25+00:00

My junk mail folder has been filling up with messages composed in what appears

  • 0

My junk mail folder has been filling up with messages composed in what appears to be the Cyrillic alphabet. If a message body or a message subject is in Cyrillic, I want to permanently delete it.

On my screen I see Cyrillic characters, but when I iterate through the messages in VBA within Outlook, the ‘Subject’ property of the message returns question marks.

How can I determine if the subject of the message is in Cyrillic characters?

(Note: I have examined the ‘InternetCodepage’ property – it’s usually Western European.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T19:42:25+00:00Added an answer on May 10, 2026 at 7:42 pm

    The String datatype in VB/VBA can handle Unicode characters, but the IDE itself has trouble displaying them (hence the question marks).

    I wrote an IsCyrillic function that might help you out. The function takes a single String argument and returns True if the string contains at least one Cyrillic character. I tested this code with Outlook 2007 and it seems to work fine. To test it, I sent myself a few e-mails with Cyrillic text in the subject line and verified that my test code could correctly pick out those e-mails from among everything else in my Inbox.

    So, I actually have two code snippets:

    • The code that contains the IsCyrillic function. This can be copy-pasted into a new VBA module or added to the code you already have.
    • The Test routine I wrote (in Outlook VBA) to test that the code actually works. It demonstrates how to use the IsCyrillic function.

    The Code

    Option Explicit  Public Const errInvalidArgument = 5  ' Returns True if sText contains at least one Cyrillic character' ' NOTE: Assumes UTF-16 encoding'  Public Function IsCyrillic(ByVal sText As String) As Boolean      Dim i As Long      ' Loop through each char. If we hit a Cryrillic char, return True.'      For i = 1 To Len(sText)          If IsCharCyrillic(Mid(sText, i, 1)) Then             IsCyrillic = True             Exit Function         End If      Next  End Function  ' Returns True if the given character is part of the Cyrillic alphabet' ' NOTE: Assumes UTF-16 encoding'  Private Function IsCharCyrillic(ByVal sChar As String) As Boolean      ' According to the first few Google pages I found, '     ' Cyrillic is stored at U+400-U+52f                '      Const CYRILLIC_START As Integer = &H400     Const CYRILLIC_END  As Integer = &H52F      ' A (valid) single Unicode char will be two bytes long'      If LenB(sChar) <> 2 Then         Err.Raise errInvalidArgument, _             'IsCharCyrillic', _             'sChar must be a single Unicode character'     End If      ' Get Unicode value of character'      Dim nCharCode As Integer     nCharCode = AscW(sChar)      ' Is char code in the range of the Cyrillic characters?'      If (nCharCode >= CYRILLIC_START And nCharCode <= CYRILLIC_END) Then         IsCharCyrillic = True     End If  End Function 

    Example Usage

    ' On my box, this code iterates through my Inbox. On your machine,' ' you may have to switch to your Inbox in Outlook before running this code.' ' I placed this code in `ThisOutlookSession` in the VBA editor. I called' ' it in the Immediate window by typing `ThisOutlookSession.TestIsCyrillic`'  Public Sub TestIsCyrillic()      Dim oItem As Object     Dim oMailItem As MailItem      For Each oItem In ThisOutlookSession.ActiveExplorer.CurrentFolder.Items          If TypeOf oItem Is MailItem Then              Set oMailItem = oItem              If IsCyrillic(oMailItem.Subject) Then                  ' I just printed out the offending subject line '                 ' (it will display as ? marks, but I just       '                 ' wanted to see it output something)            '                 ' In your case, you could change this line to:  '                 '                                               '                 '     oMailItem.Delete                          '                 '                                               '                 ' to actually delete the message                '                  Debug.Print oMailItem.Subject              End If          End If      Next  End Sub 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 52k
  • Answers 52k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer We've since tried the latest mysql gem from github and… May 11, 2026 at 6:41 am
  • added an answer Casting to int truncates the number - same as if… May 11, 2026 at 6:40 am
  • added an answer It would easier if you had an auto_increment column to… May 11, 2026 at 6:40 am

Top Members

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.