My Assistant
![]()
Custom Search
|
![]() ![]() |
![]() |
![]() Post#1 | |
Posts: 79 Joined: 6-August 15 ![]() | I have a directory C: pers & ! Nomname & " A. Official Parts ". I would like that if the files containing A. but not entitled A. Official Parts" are replaced by A. Official Parts " I wrote a code of which a part is listed below. but it creates me a second empty file. QUOTE strPathNl = toPath & "\" & !NomName & "\A. Pieces officielles\" If fso.FileExists(strPathNl) = False Then MkDir strPathNl Else If Mid(strPathNl, longstrPath, 2) = "A." And fso.FileExists(strPathNl) = False Then MkDir strPathNl fso.CopyFolder strPathNl, strPathNl End If End If |
![]() Post#2 | |
![]() Posts: 1,369 Joined: 26-December 12 From: Berkshire Mtns. ![]() | try the Name() |
![]() Post#3 | |
Posts: 7,115 Joined: 22-December 10 From: England ![]() | Looks like if you need to create a new folder, nothing else gets done. If the destination folder already exists, nothing gets done. Does copyfolder also copy all files and subfolders? |
![]() Post#4 | |
Posts: 169 Joined: 11-January 08 ![]() | Have you tried: Dim OldFolderName As String Dim NewFolderName As String If Dir(your folder name, vbDirectory) = "" Then MkDir (your folder name) Else OldFolderName = 'your existingname' NewFolderName = 'your newname' Name OldFolderName As NewFolderName End If Andy. |
![]()
Custom Search
|
![]() | Search Top Lo-Fi | 7th December 2019 - 01:12 AM |