简体   繁体   中英

The trackrevisions method or property is not available because this command is not available for reading

I hope someone can help me. I am a programing it in C#. When I use this track revisions funcion, I meet a exception message whose content is the trackrevisions method or property is not available because this command is not available for reading.

I seach some documents but I have not any solution. Could you help me? thanks.

Word.Document document = null;
Word.Application wordApp = new Word.Application();
wordApp.Visible = true;
Word.Document wordDoc = word.Documents.Open((object)docName);
wordDoc.Activate();
oDocument = wordDoc;
oDocument.Activate();
oDocument.TrackRevisions = true

For me it was because the start up option for opening Word in reading view (mode) was enabled. To fix, open your Word document, go to File > Options > General. Find Startup options and uncheck the Open e-mail attachments and other uneditable files in reading view option.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM