Delete Blank Word Document in folder and subfolder using macro

  • Dear Friends,



    I have a query regards to deleting a blank word document in folder and subfolder using macros. Can any one help me in below scenario:


    I have many word files in folder and subfolders, in some files there is a data, but some files are totally blank.
    Now I want to delete all the files in folder and subfolders, its in huge number.



    So can you please help in this case.



    Regards,
    Harindra Devadiga

  • Re: Delete Blank Word Document in folder and subfolder using macro


    This will find all word documents in the specified directory and any sub folders and delete them.


    Important: THIS CAN NOT BE UNDONE - so use carefully :)



    use it like this:


    Code
    Sub mySub()
    '// Some code here...
    Call KillWordFiles("C:\Users\bloggsj\documents")
    '// Something else...
    End Sub


    Of course you could just use Windows Explorer's built in search functionality to achieve the same thing....

  • Re: Delete Blank Word Document in folder and subfolder using macro


    Hi Friend,


    Its great, but my requirement is little bit different


    I want to delete only the blank word document, not all word document


    Regards
    Hari

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!