Google Mail Kalender Text & Tabellen Reader Web Mehr »
Kürzlich besuchte Gruppen | Hilfe | Anmelden
Google Groups-Startseite
Nachricht von Diskussion code to move files created between two dates to folder B?
Bei der Gruppe, für die Sie eine Mitteilung verfassen, handelt es sich um eine Usenet-Gruppe. Wenn Sie in dieser Gruppe Nachrichten posten, ist Ihre E-Mail-Adresse für jeden im Internet sichtbar
Ihre Antwort wurde nicht gesendet.
Die Nachricht wurde übermittelt.
 
Von:
An:
Cc:
Nachtrag zu:
Cc hinzufügen | Nachtrag hinzufügen zu | Betreff bearbeiten
Betreff:
Bestätigung:
Geben Sie zur Bestätigung die im folgenden Bild angezeigten Zeichen oder die durchgesagten Zahlen ein, indem Sie auf das Eingabesymbol klicken. Hören Sie zu und geben Sie die gehörten Zahlen ein
 
Russ  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 4 Jul. 2007, 21:05
Newsgroups: microsoft.public.word.vba.general
Von: Russ <drsN0SPAMmi...@hotmailD0Tcom.INVALID>
Datum: Wed, 04 Jul 2007 15:05:01 -0400
Lokal: Mi 4 Jul. 2007 21:05
Betreff: Re: code to move files created between two dates to folder B?
Gil,
I also found this code snippet with Google and modified it to return
Creation Date of a file. (Note: .dll will not work in MacWord)
http://officeone.mvps.org/vba.html
I haven't tested in WinWord because I'm using MacWord 2004 at home.

You may have the function return a value as a string or date.

Function GetDateCreated(ByVal FileName As String) As Date
'Function GetDateCreated(ByVal FileName As String) As String
    Dim DSO As Object
    Dim DPs As Object

    Set DSO = CreateObject("DSOleFile.PropertyReader")
    Set DPs = DSO.GetDocumentProperties(FileName)
    GetDateCreated = DPs.DateCreated
    Set DSO = Nothing
End Function

If the function returns as a date you can use the datediff() function to
compare two dates.

> Gil,
> This will work very quickly in WinWord docs to extract document properties.
> http://word.mvps.org/FAQs/MacrosVBA/DSOFile.htm

> One of the document properties is for creation date.
> Tweak to code found in the .dot template to do what you want.

>> or something like:

>> Dim strDefFilePath As String, strFileToCopy As String
>> Dim strSourcePath As String, strSourceFile As String
>> Dim objFSO As Object

>> strSourcePath = "c:\Patients\AMR\"
>> strDefFilePath = "c:\Patients\"
>> strFileToCopy = "TorrTod.doc"
>> strSourceFile = strSourcePath & strFileToCopy

>> strSourcePath = ""     ' identify folderA
>> strDefFilePath = ""     ' identify folderB
>> strFileToCopy = "CartSamu.doc"   ' but how to identify by date or time?
>> strSourceFile = 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?

>>   ? Possibly something like:

>>       Dim date1 As String

>>       date1 = Selection.Text

>>   '   navigation code to new selection

>>       Dim date2 As String

>>       date2 = Selection.Text

>>       Dim folderA As String

>>   '    identify folderA

>>       Dim folderB As String

>>   '    identify folderB

>>   '   ??? Object.MoveFile Source, Destination

>>      WordBasic.CopyFileA folderA ?? FileName:= ??, Directory:=folderB

>>   Cheers & tia

>>   Gil  

--
Russ

 drsmN0SPAMikleAThotmailD0Tcom.INVALID


    Antwort an Autor    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.

Eine Gruppe erstellen - Google Groups - Google-Startseite - Nutzungsbedingungen - Datenschutzbestimmungen
©2009 Google