Jump to content

Recommended Posts

Posted

Hello,

 

When running the below it works until it get to the _Word_DocSaveAs line.

It returns  error = 2 and the extended com error = 2147352567. I'm using Word version 1808 and the latest Prod release of autoit.

I'm able to do the same steps manually so I know it not an file access issue.

Any ideas what To look for ?

 

 

 

#include <Word.au3>
#include <MsgBoxConstants.au3>
#include <Date.au3>


; Create application object
Local $oWord = _Word_Create()



; Open a document read-only
Local $sDocument = "C:\Word_Doc.docm"
$oDoc = _Word_DocOpen($oWord, $sDocument, Default, Default, True)

$Strdate =_NowDate ()

_Word_DocFindReplace($oDoc, "xx/xx/xxxx", $Strdate)

_Word_DocSaveAs($oDoc, "C:\Word_Doc2.docm")

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...