Copy files in VBA

I

Isbjornen

Hello,

I need to use Access VBA to copy certain files (.pdf) when
some statements are true. The problem is that Access Help
is not very helpful. I found two methods, but no examples
on how to use them. Could anybody please help explain how
to use (write code) for Copy Method and/or CopyFile Method
(or if there is something better I can use, please let me
know).
As an example, I want to copy "MyFile.pdf"
from "C:\Windows" to "C:\My Documents"

Thanx,

Isbjornen
 
R

Rick Brandt

Isbjornen said:
Hello,

I need to use Access VBA to copy certain files (.pdf) when
some statements are true. The problem is that Access Help
is not very helpful. I found two methods, but no examples
on how to use them. Could anybody please help explain how
to use (write code) for Copy Method and/or CopyFile Method
(or if there is something better I can use, please let me
know).
As an example, I want to copy "MyFile.pdf"
from "C:\Windows" to "C:\My Documents"

FileCopy "C:\Windows\MyFile.pdf" "C:\My Documents\MyFile.pdf"
 
D

Dan Artuso

Hi,
Here's a sample from Help:

Dim SourceFile, DestinationFile
SourceFile = "SRCFILE" ' Define source file name.
DestinationFile = "DESTFILE" ' Define target file name.
FileCopy SourceFile, DestinationFile ' Copy source to target.
 

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