I have the following lines of code in a .py script and I am accessing a password protected document. However, when this script runs Word asks for the password again from the user once winword.exe is visible. Is this normal behavior? I am doubtful since it asks for the password whether or not I include it in my .py file. Any input is appreciated. Following is the code:
word=win32com.client.Dispatch('Word.Application')
word.Visible=1
doc=word.Documents.Open('FilePath',PasswordDocument='PASSWORD')
On a side note, the goal is that the .docx must only be accessible via this script (which opens Word) and nothing else. Any alternate method anyone else has in mind for implementing this will also be appreciated.