I have a VBA Word macro in Office 2010 that takes a user input via an InputBox and stores the string and then searches for that string inside a Word document to delete text of a specific style following the inputted string.
However, the actual string is never "found" via the macro if I paste in some Chinese (simplified) characters, even though they are indeed found if I manually use Word's native find functionality. It does work fine in English, German, Spanish etc...
I believe this has something to do with multibyte characters not being supported or enabled or something inside of my macro; because if I step through my code, the tooltip for the variable storing the string shows the passed string as three question mark symbols: ??? even though they correctly displayed inside the InputBox.
From what I've read on this site, it sounds like the reason ??? symbols are appearing are because the Microsoft Visual Basic for Applications code editor I'm using isn't configured to support multibyte characters. Is that correct? Is there a way to enable this?
Or do I need to convert my code or something to support unicode...?: Sorry, I'm not all that knowledgeable with character encodings etc. What do you recommend to get this working?
Here's part of my code:
Code:
Sub multibyte_delete_more_linking_text()
'This script will search for a specified "more" string and then delete empty paragraphs
'or hyperlink text after it until it hits a heading style string.
Selection.HomeKey Unit:=wdStory
strText = InputBox("Type the ""More"" text to search for", "More Heading To Find", "More:")
strText = strText & Chr(13)
' Now it finds the text
Selection.Find.ClearFormatting
With Selection.Find
.Text = strText
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute
.... and so on....
Thanks in advance for your help.