[python-win32] Feature request: adding unicode method to CDispatch
timr at probo.com
Wed Oct 22 00:07:35 CEST 2008
Jacek Pliszka wrote:
> I have something like this:
> for j in doc.Tables:
> ... here I do a few searches on the date inside the table ....
> How can I do it without the method I mentioned ? I use it here to be
> able to do s=unicode(j).
You're relying on a bunch of automatic conversions here, some of which
do conversions that you don't want.
"j" is not a string here -- it is a Table object. The default property
of the Table object is a Range object. The default property of the
Range object is the Text object, which IS a Unicode string. So, instead
of relying on the default conversions, if you say this explicitly:
for j = doc.Tables
xxx = j.Range.Text
you'll find that xxx *IS* a Unicode string.
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32