Shortcut for “Open Next Document†in Word 2003?

  • Thread starter OpenNextDocumentGuy
  • Start date
O

OpenNextDocumentGuy

I need to peruse through a folder full of documents in order to print out
certain documents. Is there a way to simultaneously close the current
document and open the next document in the same folder?

For example, let’s say there is a folder with three files: A, B, and C. I
want to be able to open A, and then press a single keystroke to close A and
open B. Then, I want to be able to press a single keystroke to close B and
open C. I go through hundreds of documents like this, so it’s not practical
to open all of them simultaneously.

I’ve been playing around with recording a macro, but the problem with the
documents.open command is that it requires the filename.
 
J

Jay Freedman

I need to peruse through a folder full of documents in order to print out
certain documents. Is there a way to simultaneously close the current
document and open the next document in the same folder?

For example, let’s say there is a folder with three files: A, B, and C. I
want to be able to open A, and then press a single keystroke to close A and
open B. Then, I want to be able to press a single keystroke to close B and
open C. I go through hundreds of documents like this, so it’s not practical
to open all of them simultaneously.

I’ve been playing around with recording a macro, but the problem with the
documents.open command is that it requires the filename.

There is a way, but it's a lot more complex than anything you could do by
recording a macro.

The fundamental problem is that neither Word nor Windows can tell, by looking at
a folder, which is the "next" file after the one that's currently open.

You can use the code at
http://word.mvps.org/FAQs/MacrosVBA/ReadFilesIntoArray.htm to make a list of the
folder's files in an array. That list needs to be written into a document or a
text file and saved somewhere, because your "next document" macro is going to
have to run and stop after each keystroke, and the memory it uses will be
released each time. So the "next document" macro should open the list document,
locate the current document's name in the list, grab the name of the next
document in the list, and then close the current one and open the next one by
name.

If you need more help with the macro, it would be better to post at
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.word.vba.beginners.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top