Selecting multiple files for a macro's action?

T

Tsu Dho Nimh

I have a macro that:
1) allows the user to browse to a file containing criminal charges
2) takes two chunks of bookmarked text from that file and inserts i
into the legal complaint in two places (spots marked by mor
bookmarks)

The users like it, because it saves them time on cut and paste ... bu
now they want to be able to select multiple files at once and have th
text inserted into their document.

I know the browsing part of the macro is retrieving multiple names if
select them. How do I store them so the macro can process them on
after another?

Alternatively, is there a way to read the directory they select an
generate a form with checkboxes ... they check what they want, clic
"OK", the list is stored, and the macro reads the list of files t
process.

I don't want to hard-code a UserForm - the contents of the charge
directory will change for different divisions, and I want a genera
purpose method that can be recycled
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Tsu,

I would make use of the information in the article “How to get the names of
all the folders in the folder tree, starting
from a specified folder” at:

http://www.mvps.org/word/FAQs/MacrosVBA/ReadFoldersIntoArray.htm

and load all of the files into a multi-select Listbox on a userform.

Then you can make use of the information in the article “How to find out
which Items are selected in a Multi-Select
ListBox” at:

http://www.mvps.org/word/FAQs/Userforms/GetMultiSelectValues.htm

to determine which files had been selected and process them as required.

*If you're seeing this through Rubin's crappy web site, you should know
that he does not have my permission to include this message on his website.
I own the copyright, and I grant a license to Microsoft, Google and the
usenet community. I deny Rubin the right to repost my message on his site.*

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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