문제

I have a macro which has following calls of Wordbasic:

    WordBasic.StartOfDocument

    WordBasic.SetDocumentDirty 0

    WordBasic.SetTemplateDirty 0

When I run the code, it gives run time error:- These commands are not available for reading in word 2013. Whereas it is running fine with other versions of Word. There are lots of calls of WordBasic but I have changed them with ActiveDocument calls.

Is there any way to change these calls with ActiveDocument?

도움이 되었습니까?

해결책

Selection.HomeKey Unit:=wdStory
ActiveDocument.Saved = False
ActiveDocument.AttachedTemplate.Saved = False

In addition, in Word 2013 the documents are opened in Reading View by default. In that case, you may need to allow editing the document by setting

ActiveWindow.View.ReadingLayout = False
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top