[python-win32] Setting UserInitials in Office

Tim Roberts timr at probo.com
Mon May 3 18:43:56 CEST 2010


Mike Driscoll wrote:
>
> Ah...I must have had something in my eye at the time. Anyway, I
> figured out how to get the information from it, but not how to write
> it. I tried writing to the Registry using _winreg.SetValueEx and
> passed a plain string and then various encoded strings (like utf16,
> utf32, etc). It writes just fine, but if I open Microsoft Word and
> check for the new initials or Full Name, Word just shows junk.

This works:
    _winreg.SetValueEx( k, "UserInitials", 0, _winreg.REG_BINARY,
u"timr\0" )

Note the trailing 0.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list