locked
A script file to open a word document and save it in My Documents folder RRS feed

  • Question

  • Hello.

    I want to open a word document and save it in my documents in Windows 7 using a script file.

    I know hot to open the file by a batch file but I can not save the file.

    Many Thanks

    Wednesday, July 3, 2013 6:27 AM

Answers

  • Try the following:

    Set oWord = CreateObject("Word.Application")
    oWord.Visible = True
    oWord.Documents.Open "C:\Folder_a\Doc_1.docx"
    oWord.ActiveDocument.SaveAs("C:\Folder_b\Doc_2.docx")

    Max Meng
    TechNet Community Support

    • Marked as answer by Max Meng Tuesday, July 9, 2013 1:58 AM
    Thursday, July 4, 2013 6:30 AM

All replies

  • Try the following:

    Set oWord = CreateObject("Word.Application")
    oWord.Visible = True
    oWord.Documents.Open "C:\Folder_a\Doc_1.docx"
    oWord.ActiveDocument.SaveAs("C:\Folder_b\Doc_2.docx")

    Max Meng
    TechNet Community Support

    • Marked as answer by Max Meng Tuesday, July 9, 2013 1:58 AM
    Thursday, July 4, 2013 6:30 AM
  • Thanks
    Sunday, July 7, 2013 7:00 AM