Posts by ZenPanda

    Thanks Roy, I appreciate the points re ActiveDocument and Application.DisplayAlerts; these have now been removed.

    I changed the "savechanges" as recommended, unfortunately this still showed the save prompt

    Code used:

    Hi Roy

    I appreciate your suggestion, unfortunately I'm still prompted with the save prompt. I attach the amended code, preceded by my code to generate 3 blank docs with headers

    Thanks Roy, much appreciated. My work have encouraged me to use forums to get the answers I'm looking for as they're very busy and want me to be proactive.

    I've fixed the strName, I still can't get the save prompt to stop showing though.



    First time on here, so if I'm doing anything I shouldn't, please be kind and just let me know.

    I'm a trainee and in one of my exercises is the following task:

    (a) write a macro that uses a For loop to do this – if the document name begins with the word “Document” then close that document.
    (b) can you write the code so that the client is not prompted to save every time one of the documents is closed?

    I have tried doc.Close (wdDoNotSaveChanges) but this still brings up the prompt to save for each document.

    I look forward to hearing from you as I am well and truly stumped! ?(

    Many thanks