473,395 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Converting Unicode Strings in Access/Basic

I'm using the following code to retrieve a list of all the Categories
used by Microsoft Outlook:

sub test()
Dim objWSHShell As Object
Dim strCategoryList As Variant

Set objWSHShell = CreateObject("WScript.Shell")
strCategoryList = objWSHShell.RegRead_
("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0 \Outlook\Categories\MasterList")

end sub

Upon viewing strCategoryList, I can see that I have unicode characters.
What I'd like to do is convert this unicode string to a normal string
that works with VB functions.

How can I do that?

By the way, I tried to declare strCategoryList as a String variable,
but received a type mismatch when it attempted to copy the values.
Any help would be appreciated. I'm a Unicode Newbie!

Terry

Nov 13 '05 #1
8 3845
Ooops! I suppose I should have said that I'm using Access 2003 and
Outlook 2003.

Thanks,

Terry

Nov 13 '05 #2
Alphaboomer wrote:
I'm using the following code to retrieve a list of all the Categories
used by Microsoft Outlook:

sub test()
Dim objWSHShell As Object
Dim strCategoryList As Variant

Set objWSHShell = CreateObject("WScript.Shell")
strCategoryList = objWSHShell.RegRead_
("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0 \Outlook\Categories\MasterList")
end sub

Upon viewing strCategoryList, I can see that I have unicode characters. What I'd like to do is convert this unicode string to a normal string
that works with VB functions.

How can I do that?


If your problem is really converting from Unicode, the StrConv function
using the vbFromUnicode constant should work. Also, I feel comfortable
using the Outlook Object Model so perhaps check to see if Categories
are part of the Object Model.

James A. Fortune

A form's complexity seldom grows linearly with the number of controls
on it.

Nov 13 '05 #3
James,

Thanks for your reply. Unfortunately, any time I try to use a string
conversion function, I get a type mismatch error (13).

According to some other Outlook forums, the only location that stores
the Master Category list is the registry.
Any other ideas would be appreciated!

Terry

Nov 13 '05 #4
James,

Thanks for your reply. Unfortunately, any time I try to use a string
conversion function, I get a type mismatch error (13).

According to some other Outlook forums, the only location that stores
the Master Category list is the registry.
Any other ideas would be appreciated!

Terry

Nov 13 '05 #5
On 9 Dec 2004 14:24:30 -0800, "Alphaboomer" <al*********@hotmail.com>
wrote:
I'm using the following code to retrieve a list of all the Categories
used by Microsoft Outlook:

sub test()
Dim objWSHShell As Object
Dim strCategoryList As Variant

Set objWSHShell = CreateObject("WScript.Shell")
strCategoryList = objWSHShell.RegRead_
("HKEY_CURRENT_USER\Software\Microsoft\Office\11. 0\Outlook\Categories\MasterList")

end sub

Upon viewing strCategoryList, I can see that I have unicode characters.
What I'd like to do is convert this unicode string to a normal string
that works with VB functions.

How can I do that?

By the way, I tried to declare strCategoryList as a String variable,
but received a type mismatch when it attempted to copy the values.
Any help would be appreciated. I'm a Unicode Newbie!

Terry


Hi
This surely should work without any conversion, as VB works in unicode
internally. Your code worked for me (admittedly with a different
registry string) both in vb6 and in Access 97 with strCategoryList
declared as a string.
David

Nov 13 '05 #6
On 9 Dec 2004 14:24:30 -0800, "Alphaboomer" <al*********@hotmail.com>
wrote:
I'm using the following code to retrieve a list of all the Categories
used by Microsoft Outlook:

sub test()
Dim objWSHShell As Object
Dim strCategoryList As Variant

Set objWSHShell = CreateObject("WScript.Shell")
strCategoryList = objWSHShell.RegRead_
("HKEY_CURRENT_USER\Software\Microsoft\Office\11. 0\Outlook\Categories\MasterList")

end sub

Upon viewing strCategoryList, I can see that I have unicode characters.
What I'd like to do is convert this unicode string to a normal string
that works with VB functions.

How can I do that?

By the way, I tried to declare strCategoryList as a String variable,
but received a type mismatch when it attempted to copy the values.
Any help would be appreciated. I'm a Unicode Newbie!

Terry


Hi
This surely should work without any conversion, as VB works in unicode
internally. Your code worked for me (admittedly with a different
registry string) both in vb6 and in Access 97 with strCategoryList
declared as a string.
David

Nov 13 '05 #7
Thanks to all - the problem is solved.

Apparently the registry entry is stored in a binary format, not
Unicode.

Sorry for the annoyance!

Terry

Nov 13 '05 #8
Thanks to all - the problem is solved.

Apparently the registry entry is stored in a binary format, not
Unicode.

Sorry for the annoyance!

Terry

Nov 13 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: ..... | last post by:
I have an established program that I am changing to allow users to select one of eight languages and have all the label captions change accordingly. I have no problems with English, French, Dutch,...
30
by: aurora | last post by:
I have long find the Python default encoding of strict ASCII frustrating. For one thing I prefer to get garbage character than an exception. But the biggest issue is Unicode exception often pop up...
10
by: Maxim Kasimov | last post by:
there are a few questions i can find answer in manual: 1. how to define which is internal encoding of python unicode strings (UTF-8, UTF-16 ...) 2. how to convert string to UCS-2 (Python 2.2.3...
22
by: Keith MacDonald | last post by:
Hello, Is there a portable (at least for VC.Net and g++) method to convert text between wchar_t and char, using the standard library? I may have missed something obvious, but the section on...
2
by: Gidi | last post by:
Hi, I'm writing a C# win application program, and i need to transfer my hebrew letters from unicode to ascii, now if i use the ascii encoding it writes me ??? instead of the hebrew letter i've...
9
by: Hugo Amselschlag | last post by:
Hi there, I've implemented a local system hook to suppress certain windows beeing displayed by the axWebbrowser control. Now I need some more information before I can decide, whether to suppress...
15
by: John Salerno | last post by:
Forgive my newbieness, but I don't quite understand why Unicode is still something that needs special treatment in Python (and perhaps elsewhere). I'm reading Dive Into Python right now, and it...
40
by: apprentice | last post by:
Hello, I'm writing an class library that I imagine people from different countries might be interested in using, so I'm considering what needs to be provided to support foreign languages,...
24
by: Donn Ingle | last post by:
Hello, I hope someone can illuminate this situation for me. Here's the nutshell: 1. On start I call locale.setlocale(locale.LC_ALL,''), the getlocale. 2. If this returns "C" or anything...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.