Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Burn CD from MS Access

Posted on 2014-04-06
3
Medium Priority
?
869 Views
Last Modified: 2014-04-06
Hi,

I'm looking at adding a burn files to CD option in my MS Access database.  My database includes the path to the folder with the files which need to be burned to the CD.

The code I have found is below, however, it doesnt seem to work.  It errors out at :

strDriveLetter = Application.InputBox("Driveletter : ", "Driveletter", "D", Type:=2) & ":\"  

Can anyone help?

Sub burn_a_cd() 
     'Provide the drive letter of your CD burner
    strDriveLetter = Application.InputBox("Driveletter : ", "Driveletter", "D", Type:=2) & ":\" 
     'Provide the source directory. We made one on the c drive
     'and everything we put in this directory will be put on a cd
    strSourceDirectory = "C:\TOBURN" 
     'Provide a volume name for your CD (16 characters max)
    strCDName = Date 
    Const MY_COMPUTER = &H11 
    Set WShshell = CreateObject("WScript.Shell") 
    Set objShell = CreateObject("Shell.Application") 
    strBurnDirectory = WShshell.RegRead( _ 
    "HKCU\Software\Microsoft\Windows\CurrentVersion\" _ 
    & "Explorer\Shell Folders\CD Burning") 
    Set objFolder = objShell.Namespace(strSourceDirectory) 
    objShell.Namespace(strBurnDirectory).CopyHere objFolder.Items 
    objShell.Namespace(&H11&).ParseName(strDriveLetter).InvokeVerbEx ( _ 
    "Write &these files to CD") 
End Sub

Open in new window

0
Comment
Question by:anthonytr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 51

Accepted Solution

by:
Gustav Brock earned 2000 total points
ID: 39981263
This should do:

strDriveLetter = InputBox("Driveletter: ", "Driveletter", "D") & ":\"

/gustav
0
 

Author Comment

by:anthonytr
ID: 39981271
That's great - thank you
0
 
LVL 51

Expert Comment

by:Gustav Brock
ID: 39981277
You are welcome!

/gustav
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question