Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jan 2003
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Move files from one folder to another (Windows 2000/Office 2000)

    HansV kindly provided me with the following code, which works great in reading Word

  2. #2
    2 Star Lounger
    Join Date
    Jan 2003
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Move files from one folder to another (Windows 2000/Office 2000)

    Many, many thanks for the quick response. I will soon try incorporating the code you sent. For my clarification, please:
    Quote
    and before you run Dir() again at the end of the loop:
    Name strDocPath & strFile As strDocProcessedPath & StrFile ' move the file
    Unquote
    Should the "Name strDocPath" be the same as the constant declared at the beginning, e.g., strDocProcessedPath?
    Thanks again for your help!...Mary

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Move files from one folder to another (Windows 2000/Office 2000)

    Hasse is not online at the moment, so I'll venture to guess that he meant

    Name cstrDocPath & strFile As strDocProcessedPath & strFile

    The Name instruction has the general form Name oldpath As newpath. If oldpath and newpath have the same drive/folder path, or if only a file name is specified, the file is renamed. If newpath has a different path than oldpath, the file will be moved.

  4. #4
    2 Star Lounger
    Join Date
    Jan 2003
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Move files from one folder to another (Windows 2000/Office 2000)

    Hello, Hans...Many thanks for clarifying. I'm looking forward to incorporating the code and testing the results soon....Mary

  5. #5
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Leuven, Vlaanderen, Belgium
    Posts
    322
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Re: Move files from one folder to another (Windows 2000/Office 2000)

    (Edited by HansV to activate URL - see <!help=19>Help 19<!/help>)

    Add at the beginning:

    ...
    Const cstrDocProcessedPath as String = "C:ProcessedFiles" ' processed file location (personally I should avoid spaces)
    ...

    and before you run Dir() again at the end of the loop:

    ...
    Name cstrDocPath & strFile As cstrDocProcessedPath & StrFile ' move the file
    ...
    (Based on: http://www.erlandsendata.no/english/index....rsbasicexamples <img src=/S/bow.gif border=0 alt=bow width=15 height=15>)

  6. #6
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Leuven, Vlaanderen, Belgium
    Posts
    322
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Re: Move files from one folder to another (Windows 2000/Office 2000)

    Just to mention I corrected my previous post: "c" is added in prefix constant... and thanks Hans for answering!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •