Possible Method (Script?) to Save Open Files in Word, Close Word, then Re-Open Word With Last Document Open?

Posted on 2012-09-20
Last Modified: 2012-10-12
Good Morning All -

This weekend, I must deploy a new file (overwriting an old one) to all workstations.  The file is referenced by Microsoft Word 2010 therefore Word must be closed for the file to successfully copy.  Also, I'm using SCCM 2012 to accomplish this.

I created a task sequence which does the following:
- Force Word to quit ("tskill winword /a")
- Copies file (xcopy string)

It works great and I am deploying it early in the morning - however - we have some people who work at all hours.  Ideally, I'm trying to find the best method to where there is no interruption as I know people leave Word docs open overnight, too.

Therefore, what I'm trying to find is a method or script which would do the following:
1. Save any open documents in Word if there are any open
2. Exit or taskkill Word
3. Pause to let me copy the file /w xcopy
4. Re-Open Word with the last document that was open - IF - Word was previously open when script began

I know that this is a lot to ask and maybe not possible without hours of coding.  Still, why not ask.

Question by:BzowK
    1 Comment
    LVL 14

    Accepted Solution

    There is no way to send a command from the command line to the MS Word UI, so you cannot force it to save and shut down.  You may have to simple resort to sending out an email or message that Word is shutting down in five minutes, please save your work.  If you enable the Messenger Service on all of your computers, you can send a net message.  

    Here is info on how to do that:

    You could maybe write a batch file that sends a warning message to all computers, wait for five minutes, then taskkill Word and copy in the files.  I ususally use the ping command to pause a batch file - this will pause for about five minutes.

    PING -n 301

    Good Luck!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
    This article will show, step by step, how to integrate R code into a R Sweave document
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now