4
votes

I am editing Word documents I get from clients with VBA, and the clients often give them to me in an 'uneditable view'. Thus, I would like to 'enable editing' in within my macro before doing my tasks.

Note that I did not say the document is in 'read-only' as I do not think it is (I do not see the [read only] text in the document title bar when I open it manually). I have also tried setting readOnly=false as described in this post, but it did not make a difference to how the document opened. what I am seeing when I open the document manually is a '2-page view' with arrows on the sides to page forward/back, and when I try to edit the document I see a status message in the lower-left corner of the document's frame: This modification is not allowed because this document is opened for viewing only. I can manually make the document editable by going to View > Edit Document.

1

1 Answers

6
votes

I spent a while searching for this one as I didn't know the view was called 'read-mode', so I thought it was worth sharing. My strategy was to 'toggle off read-mode' once I opened my document with this line: ActiveDocument.ActiveWindow.View.ReadingLayout = False

REF: https://msdn.microsoft.com/en-us/vba/word-vba/articles/view-readinglayout-property-word