'If you want to quit the entire Application: Item:=0, IncludeDocProps:=True, KeepIRM:=True, _ĬreateBookmarks:=0, DocStructureTags:=True, _īitmapMissingFonts:=True, UseISO19005_1:=False WordDoc.ExportAsFixedFormat OutputFileName:= _ġ7, OpenAfterExport:=False, OptimizeFor:= _ Set WordApp = CreateObject("Word.Application") Your final code might look like this: Sub pdf() Other options for the Quit and Close methods can be found in the documentation: Application.Quit Document.Close. Doesn't work if you closed the file normally. However, if you close a file and click Dont Save, the file is deleted from the AutoRecovery folder. The autorecovery is helpful for program or system crashes, it saves a temp file that can be recovered. 1 Answer Sorted by: 7 If the application crashed, then it would still be possible to recover it at /Users/ username/Library/Application Support/ Microsoft/Office/Office 2011 AutoRecovery. You can try WordDoc.Close SaveChanges:=wdDoNotSaveChanges before the Set WordDoc = NothingĪlso, if you want to quit the program entirely you should indeed send the command to quit it before setting the variable to Nothing: WordApp.Quit SaveChanges:=wdDoNotSaveChanges But as you may have noticed, once you close a file without saving changes, those changes are lost and not recoverable.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |