Forum Discussion
VBA Word copy full content with Restricted editing
My question is, in vba, how can I copy an opened full word document content to the current word document, with copying EVERYTHING? No matter what I tried, I could not copy the Restrict Editing, only the rest of the content. I created the document. However, I would also like to copy these restrictions, but I can't. I have the right to do it, but the restrictions are not created in the copy. I want to save the structure and code of the current file menu with the content from the old, pasted from another file.
I also tried this, it copies everything, but the restricted edit disappears.
oWord.Activate oWord.Selection.WholeStory 'Select whole document oWord.Selection.Expand wdParagraph 'Expands your selection to current paragraph oWord.Selection.Copy 'Copy your selection ThisDocument.Activate Selection.EndKey wdStory 'Move to end of document Selection.Paste 'Pastes in the content
13 Replies
- KondorosyCopper Contributor
Stefan_Blom That's exactly what I did, but it doesn't work well, because although it copies everything, it just doesn't copies the mark of the Restricted Edit sections.
You may have to share the code you are using, for someone to be able to provide a workaround.