Thread: [Solved] Acronym Finder
View Single Post
 
Old 09-22-2014, 10:49 PM
Cray_Z Cray_Z is offline Windows 7 32bit Office 2007
Novice
 
Join Date: Sep 2014
Posts: 16
Cray_Z is on a distinguished road
Default Acronym Finder

I had those lines so it looked like: DocAcro.Close Savechanges:=wdDoNotSaveChanges
DocSrc.Close Savechanges:=wdDoNotSaveChanges
Set oTbl = Nothing: Set DocAcro = Nothing: Set DocSrc = Nothing: Set DocTgt = Nothing

And I also tried:
DocAcro.Close False: DocSrc.Close False (I tried True as well)
Set oTbl = Nothing: Set DocAcro = Nothing: Set DocSrc = Nothing: Set DocTgt = Nothing

But for some reason it leaves one or both of the documents open and I am unable to close them out with the X in the upper right hand corner. I end up going to the task bar and right clicking the Word icon and then clicking "close all windows." Only then do the windows close properly.

I am using the code:

With DocSrc
currDoc = .FullName
.Close SaveChanges:=wdDoNotSaveChanges
End With
With DocAcro
currDoc = .FullName
.Close SaveChanges:=wdDoNotSaveChanges
End With

And it closes out both documents for me. Just wondering if you have any idea why the two sample codes above do not work and yet the last one works? I prefer to have the code as efficient as possible but don't understand why one works and one doesn't.
Reply With Quote