A
Armin Laschet
Hi all,
I'm writing a macro in Word 2003 that should count words in .doc, .xls
and .ppt files. For Word and PowerPoint I use the built-in
ComputeStatistics(wdStatisticWords) and
BuiltInDocumentProperties("Number of words"). I loop over all 5500
files in a folder. That works ok. I managed to let the macro do its job
without any dialogs pooping up, e.g. when a document is
readonlyrecommended or has Auto-Macros etc. For Excel and Word I send a
dummy password, in order to get a run time error, that I catch, so that
I know, that I can't count the words in the respective protected
workbook/document -> (put a respective message in the log file).
Maybe by now you know where I stumble. Since there is no password to be
sent with the open method for a PowerPoint presentation, I cannot go
for a coffee, while my proggy does its job. I have to sit and watch the
screen, if any password dialog comes up that I have to cancel.
I tried the SendKeys procedures supplied by Shyam and, off course, they
don't work for me. It never makes it to the password dialog.
I tried the dsofile.dll as well - gives me word count 0 for each
password protected document.
Has anyone got an idea, how I can find out whether a presentation is
password protected or is there a 'safe' API-kind-of-solution to cancel
the password dialog?
Best regards
Armin Laschet
I'm writing a macro in Word 2003 that should count words in .doc, .xls
and .ppt files. For Word and PowerPoint I use the built-in
ComputeStatistics(wdStatisticWords) and
BuiltInDocumentProperties("Number of words"). I loop over all 5500
files in a folder. That works ok. I managed to let the macro do its job
without any dialogs pooping up, e.g. when a document is
readonlyrecommended or has Auto-Macros etc. For Excel and Word I send a
dummy password, in order to get a run time error, that I catch, so that
I know, that I can't count the words in the respective protected
workbook/document -> (put a respective message in the log file).
Maybe by now you know where I stumble. Since there is no password to be
sent with the open method for a PowerPoint presentation, I cannot go
for a coffee, while my proggy does its job. I have to sit and watch the
screen, if any password dialog comes up that I have to cancel.
I tried the SendKeys procedures supplied by Shyam and, off course, they
don't work for me. It never makes it to the password dialog.
I tried the dsofile.dll as well - gives me word count 0 for each
password protected document.
Has anyone got an idea, how I can find out whether a presentation is
password protected or is there a 'safe' API-kind-of-solution to cancel
the password dialog?
Best regards
Armin Laschet