How do I combine 2 vba scripts into one RRS feed

  • Question

  • Good morning all,

    I plot pdf's from Autocad and depending if it's from model space or layout I get an output with Model (1) or Layout (1). Currently I am using following script to take care of stripping Model (1) from filename

    folderspec = "C:\Dave\"
    strRename = ""

    set fs = CreateObject("Scripting.FileSystemObject")
    set f = fs.GetFolder(folderspec)

    for each f1 in f.files
    Filename = folderspec &
    NewFilename = replace(Filename, " Model (1)", strRename)
    fs.MoveFile Filename, NewFilename

    msgbox "All Done"

    How can I combine above script to take care of Layout (1) if included in my directory? I would like it to strip Model (1) and Layout (1) if I have that part of filename in my directory. Any help would be greatly appreciated.

    Thank you,


    Wednesday, October 9, 2019 12:35 PM