Hi, I ended up doing things manually for the first round, but I have now to do it one more time and a fully automatic version would be great. I tried to find some more information as to how to use activeX and how to control Word through Matlab. however, I failed to find a good overview of all the possibilities that the actxserver proposes.
an answer to this thread: https://se.mathworks.com/matlabcentral/answers/348737-how-to-read-ms-word-file-doc-docx
give links to the VBA library for "documents" object: https://docs.microsoft.com/en-us/office/vba/api/Word.Document
but I'm not sure I understand fully how to use the library.
Notably, it seems that the only way to actual open a word document is to use the varDoc.Documents.Open('fileName.doc') function. this as I understand it (please correct me if I'm wrong) do the same as if I was manually double clicking on the file to open the document.
As mentioned, as the file is password protected, i get the pop-up window to either insert the password, or to open the file as "read only". once I click manually on "read only" I get to access the document. I can then do varDoc.ReadOnly to get the property of the document telling me that indeed this document is read only.
What I guess I would like Matlab to do is to automatically open the file as "read only" to avoid the pop-up window to appear. and actually it seems that this is not possible as even directly with word I cannot open the document without having the pop-up appearing. and hence what I would like to automatize is simply not possible with password protected documents.
do you have any further ideas? as mentioned, I cannot "take control" of the pop-up from Matlab as basically it is "waiting" as busy for the document to be finished with the varDoc.Documents.Open('fileName.doc') action...that is not happening until the pop-up is closed.
does a "OpenAsReadOnly" function exists? I could not find it in the VBA library.
As mentioned, I will have to click 132 times on "Read Only" for this new round which I would gladly avoid.
Thanks a lot for your help.