PC Review


Reply
Thread Tools Rate Thread

Copy files in VBA

 
 
Isbjornen
Guest
Posts: n/a
 
      25th Sep 2003
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
 
Reply With Quote
 
 
 
 
Rick Brandt
Guest
Posts: n/a
 
      26th Sep 2003
"Isbjornen" <(E-Mail Removed)> wrote in message
news:0ece01c383b5$94dff3d0$(E-Mail Removed)...
> 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"


 
Reply With Quote
 
Dan Artuso
Guest
Posts: n/a
 
      26th Sep 2003
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.

--
HTH
Dan Artuso, Access MVP


"Isbjornen" <(E-Mail Removed)> wrote in message news:0ece01c383b5$94dff3d0$(E-Mail Removed)...
> 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



 
Reply With Quote
 
Isbjornen
Guest
Posts: n/a
 
      26th Sep 2003

>-----Original Message-----
>"Isbjornen" <(E-Mail Removed)> wrote in message
>news:0ece01c383b5$94dff3d0$(E-Mail Removed)...
>> 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"

Thanx,
Sure beats Copy and CopyFile...

Isbjornen
 
Reply With Quote
 
New Member
Join Date: Feb 2010
Posts: 2
 
      4th Feb 2010
Hi guys,

I am using same code to overwrite a file but sometimes the destination files is getting lost...some how the code is deleting it.

Do you have any idea, what could be happening?

I appreciate your help
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I am looking for a file copy program that will simply copy files without stopping LarryB Windows XP 6 8th Mar 2007 08:24 PM
Reinstalled 2nd copy of WindowsXP but now cant read files from 1st Copy Carey Frisch [MVP] Microsoft Access 4 13th Jun 2005 08:47 PM
using File.Copy to copy files to shared hosting site Steve Richter Microsoft ASP .NET 4 18th Apr 2005 04:06 PM
Still unable to copy files to CD-R using WinXP copy feature GJP Windows XP New Users 7 16th Oct 2004 06:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:28 AM.