FAQ
I want to use python to do some automatical operation on windows.
the following is the code, which try to open a file with unicode
characters in its filename in msword
but I can't get it work correctly. Can anybody help me?

if that is the shortcoming of WScript, is there any other way to do so
in python?
(I know there is something like autohotkey, but I am not willing to
learn a new langauge )

thanks in advance


import time
import win32com.client

shell = win32com.client.Dispatch("WScript.Shell")
shell.AppActivate('winword')
time.sleep(0.1)

shell.SendKeys('%fo') # Alt+F, O
time.sleep(0.1)

path=r'c:\some unicode in file name.doc'
shell.SendKeys(path) #
fail on this line, no unicode appeared
shell.SendKeys('{ENTER}')

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedAug 10, '10 at 3:04a
activeAug 10, '10 at 3:04a
posts1
users1
websitepython.org

1 user in discussion

Oyster: 1 post

People

Translate

site design / logo © 2022 Grokbase