Open the only document in a folder

  • Thread starter Douglas McKibbin
  • Start date
D

Douglas McKibbin

How can I use a VB macro to open the only document in a folder? Are
there "wild card" symbols like "*" that would substitute for portions
of the file name such as "********.rtf" ?
Thanks
 
J

John McGhie [MVP - Word and Word Macintosh]

Use the DIR function to return the file name and path to OPEN. (Look up
Dire in the Word VBA help).

E.g. Dir("SomePath", MacID("TEXT"))

PC wildcards are not supported in VBA in Mac Word. For MacID try "RTF "
(note the space after the F).

Word uses the Apple Finder for all file operations, so this is easier/more
reliable from AppleScript.

Cheers

How can I use a VB macro to open the only document in a folder? Are
there "wild card" symbols like "*" that would substitute for portions
of the file name such as "********.rtf" ?
Thanks

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 4 1209 1410
 

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