Run Macro in mutiple file placed in a comman folder RRS feed

  • General discussion

  • i want aRun Macro in mutiple files placed in a comman folder

    • Edited by ALI74 Wednesday, December 19, 2012 11:59 AM
    Tuesday, December 18, 2012 4:12 AM

All replies

  • Sub ProcessFolder()
        ' Change as needed but keep \ at the end
        Const strFolder = "C:\MyFolder\"
        Dim strFile As String
        Dim doc As Document
        strFile = Dir(strFolder & "*.doc*")
        Do While strFile <> ""
            Set doc = Documents.Open(strFolder & strFile)
            Call RunAll
            doc.Close SaveChanges:=True
            strFile = Dir
    End Sub

    Regards, Hans Vogelaar

    Tuesday, December 18, 2012 7:13 AM
  • run Thanks


    Please reinstate your first post's original content. Without it you have destroyed the context for the rest of the thread.

    Paul Edstein
    [MS MVP - Word]

    Wednesday, December 19, 2012 11:34 AM