Nachricht von Diskussion
code to move files created between two dates to folder B?
Reply-To: "gil" <NoG...@EmailAddress.com>
From: "gil" <gil...@bellsouth.net>
References: <eEBS2KmvHHA.4552@TK2MSFTNGP03.phx.gbl>
Subject: Re: code to move files created between two dates to folder B?
Date: Wed, 4 Jul 2007 13:54:28 -0400
Lines: 198
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_001B_01C7BE42.D81D8240"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
Message-ID: <#babfRmvHHA.4916@TK2MSFTNGP04.phx.gbl>
Newsgroups: microsoft.public.word.vba.general
NNTP-Posting-Host: adsl-074-167-179-099.sip.ard.bellsouth.net 74.167.179.99
Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!feeder.news.tin.it!207.46.248.126.MISMATCH!TK2MSFTFEEDS01.phx.gbl!TK2MSFTFEEDS02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP04.phx.gbl
This is a multi-part message in MIME format.
------=_NextPart_000_001B_01C7BE42.D81D8240
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
or something like:
Dim strDefFilePath As String, strFileToCopy As String
Dim strSourcePath As String, strSourceFile As String
Dim objFSO As Object
strSourcePath =3D "c:\Patients\AMR\"
strDefFilePath =3D "c:\Patients\"
strFileToCopy =3D "TorrTod.doc"
strSourceFile =3D strSourcePath & strFileToCopy
strSourcePath =3D "" ' identify folderA
strDefFilePath =3D "" ' identify folderB
strFileToCopy =3D "CartSamu.doc" ' but how to identify by date or =
time?
strSourceFile =3D strSourcePath & strFileToCopy
' ... but it needs to move over up to 10 jpg files
:)
Gil
"gil" <gil...@bellsouth.net> wrote in message =
news:eEBS2KmvHHA.4552@TK2MSFTNGP03.phx.gbl...
Hi All, . I am seeking vba code to MOVE files created between date1 =
and date2 from folderA to folderB?
=20
? Possibly something like:=20
=20
Dim date1 As String
date1 =3D Selection.Text
' navigation code to new selection
Dim date2 As String
date2 =3D Selection.Text
Dim folderA As String
' identify folderA
Dim folderB As String
' identify folderB
' ??? Object.MoveFile Source, Destination
WordBasic.CopyFileA folderA ?? FileName:=3D ??, =
Directory:=3DfolderB
=20
Cheers & tia
Gil =20
=20
------=_NextPart_000_001B_01C7BE42.D81D8240
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o =3D "urn:schemas-microsoft-com:office:office"><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16481" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#e0dfe3>
<DIV><FONT face=3DArial>or something like:</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial>Dim strDefFilePath As String, strFileToCopy As=20
String<BR>Dim strSourcePath As String, strSourceFile As String<BR>Dim =
objFSO As=20
Object</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial>strSourcePath =3D =
"c:\Patients\AMR\"<BR>strDefFilePath =3D=20
"c:\Patients\"<BR>strFileToCopy =3D "TorrTod.doc"<BR>strSourceFile =3D =
strSourcePath=20
& strFileToCopy</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV><FONT face=3DArial>
<DIV><BR>strSourcePath =3D "" ' identify=20
folderA<BR>strDefFilePath =3D "" ' identify=20
folderB<BR>strFileToCopy =3D "CartSamu.doc" ' but how to =
identify by=20
date or time?<BR>strSourceFile =3D strSourcePath & =
strFileToCopy<BR></DIV>
<DIV>' ... but it needs to move over up to 10 jpg =
files</DIV>
<DIV> </DIV>
<DIV>:)</DIV>
<DIV>Gil</DIV></FONT>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV>"gil" <<A=20
href=3D"mailto:gil...@bellsouth.net">gil...@bellsouth.net</A>> =
wrote in=20
message <A=20
=
href=3D"news:eEBS2KmvHHA.4552@TK2MSFTNGP03.phx.gbl">news:eEBS2KmvHHA.4552=
@TK2MSFTNGP03.phx.gbl</A>...</DIV>
<DIV><FONT face=3DArial>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT=20
face=3D"Times New Roman">Hi All, =85 I am seeking vba code to MOVE =
files created=20
between date1 and date2 from folderA to folderB?</P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT=20
face=3DArial></FONT></o:p> </P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT =
face=3DArial>?=20
Possibly something like:</FONT> </o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT=20
face=3DArial></FONT></o:p> </P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"></FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT=20
face=3D"Times New Roman"><SPAN style=3D"mso-spacerun: =
yes"> =20
</SPAN>Dim date1 As String<o:p></o:p></FONT></P><FONT=20
face=3D"Times New Roman"><SPAN style=3D"mso-spacerun: yes">
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT=20
face=3D"Times New Roman"><SPAN style=3D"mso-spacerun: =
yes"> =20
</SPAN>date1 =3D Selection.Text<o:p></o:p></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT=20
face=3D"Times New Roman">'<SPAN style=3D"mso-spacerun: =
yes"> =20
</SPAN>navigation code to new selection<o:p></o:p></FONT></P><FONT=20
face=3D"Times New Roman"><SPAN style=3D"mso-spacerun: yes">
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"> =
Dim date2 As=20
String<o:p></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"> =
</SPAN>date2=20
=3D Selection.Text<o:p></o:p></FONT></P></SPAN></FONT>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT=20
face=3D"Times New Roman"> Dim folderA As =
String</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT=20
face=3D"Times New Roman">' identify=20
folderA<o:p></o:p></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT=20
face=3D"Times New Roman"><SPAN style=3D"mso-spacerun: =
yes"> =20
</SPAN>Dim folderB As String</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT=20
face=3D"Times New Roman">' identify =
folderB</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT=20
face=3D"Times New Roman"></FONT> </P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT=20
face=3D"Times New Roman">'<SPAN style=3D"mso-spacerun: =
yes"> ???=20
</SPAN>Object.MoveFile Source, Destination<o:p></o:p></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT=20
face=3D"Times New Roman"><SPAN=20
style=3D"mso-spacerun: yes"></SPAN><o:p></o:p></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><FONT=20
face=3D"Times New Roman"><SPAN style=3D"mso-spacerun: =
yes"> =20
</SPAN>WordBasic.CopyFileA folderA ?? FileName:=3D ??,=20
Directory:=3DfolderB</FONT></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p><FONT=20
face=3D"Times New Roman"> </FONT></o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p>Cheers & =
tia</o:p></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><o:p>Gil =
</o:p></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0in 0in =
0pt"><o:p></o:p> </P></FONT></DIV></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_001B_01C7BE42.D81D8240--