Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2005

Tip: Looking for answers? Try searching our database.

how to tell the program to look for the CD drive

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JEG - 11 Apr 2005 17:11 GMT
I am working on something that is going to be burned to a CD and users will
use it from their CD drive.  I need to have some macros that will print
certain files from the CD when they click a button.  How do I get the
program to look at their CD drive for the files since I won't know what
their CD drive is called (i.e. it could be their D drive, E drive, etc.)

Any help greatly appreciated!
Jackie
Jonathan West - 12 Apr 2005 10:03 GMT
>I am working on something that is going to be burned to a CD and users will
> use it from their CD drive.  I need to have some macros that will print
[quoted text clipped - 4 lines]
> Any help greatly appreciated!
> Jackie

Hi Jackie,

Your problem is more complex than even you have stated, since it is possible
for a PC to have two or more CD drives.

The key piece of information you need to get is the volume name of the
drive. Each CD has its own volume name, so if you properly define the volume
name for the CD when you create it, then if you can identify the volume name
all will be well.

So the next question is how to identify the volume name? Unfortunately,
there aren't any built-in VBA functions for this. However, Karl Peterson has
written a VB code sample that does this for you, making use of Windows API
commands. Take a look at http://vb.mvps.org/samples/project.asp?id=DrvInfo

Once you unzip the file with the samples in it, you can simply drop the
CDriveInfo.cls class module into your VBA project and use it. Karl's notes
show how to use the class, but if you have trouble with it, post back here.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org 

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.