2012-12-14 2 views
2

경고 ''워드 메모리가 부족 ' 그것들을 저장하고 닫기 전에.Word 2003에서 VBA는 - 당신이 비활성화 할 어떻게 Word 2003에서</p> <p>내가 다른 Word 문서 및 예비 작업에 여는 매크로를 실행있는 Word 문서를 가지고 실행하고

변경 횟수 때문에 'Word has insufficent memory. You will not be able to undo this action once it is completed. Do you want to continue?'프롬프트가 계속 나타납니다. 내가 생각

  • Application.DisplayAlerts = False
  • Application.DisplayAlerts = wdAlertsNone

:이 오류 '구글에서'한이 작동하지 않는 것 다음 이외의 아무것도 발견하지 않았습니다

코드가 매크로를 실행하는 문서에 적용되고 매크로가 처리중인 문서에는 적용되지 않기 때문일 수 있습니다.

아래 코드는 내가 사용하고있는 코드를 삭제 한 버전입니다. 내가 제거한 것은 로깅 기능 중 일부입니다.

Function open_word_file(file_name) 

    Call wd_backup_current_file_first(file_name) ' backup the current file - so that if damage is done, it can be undone. 

    Documents.Open FileName:=file_name, ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="", Format:=wdOpenFormatAuto, XMLTransform:="" 


    Application.DisplayAlerts = False 
    'Application.DisplayAlerts = wdAlertsNone 



    '<do_work> 
    Call do_something_with_the_opened_file 
    '</do_work> 

    ActiveDocument.Save ' save the changes 
    ActiveDocument.Close 
End Function 

답변

3

많은 시행 착오 끝에 문제를 일으키는 실행 취소 버퍼가 있습니다.

파일을 처리하는 루프 내에 다음 행을 넣었으므로 더 이상 메시지가 표시되지 않습니다.

ActiveDocument.UndoClear