简体   繁体   中英

VBA macro create temporary file

I am using a macro which creates temporary docx files that are then assembled into one. I then delete the temporary files. These files still show up in the Recent Files list, even though they no longer exist. How can I prevent these temp files from being recognized by Word as a recent file?

Or is there a way to save the contents of the would-be temporary file in an array and then use this array to complete the final file? Meaning, the temp file does not ever actually exist.

The fifth parameter of Document.SaveAs is AddToRecentFiles . Set that to False.

https://msdn.microsoft.com/en-us/library/office/aa220734

You can create the temporary files, combine them into one, and then close them without saving them.

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