15 posts in this topic
Cannot save word document - Strange/Unknown error
Hello, I am trying to save an word document but it won't work , This is my REALLY simple script:
#include <Word.au3> Global $oWord = _Word_Create(False, True) _Word_DocSaveAs($oWord) MsgBox(0, @error, @extended) And my MsgBox:
I know that its a COM error because @error is set 2... but what about the COM error code? I cannot find anything related to -2147352570!
Opening word in background
I'm trying to open a document with _WordDocOpen and replace some text in it with _Word_DocFindReplace and then print with _Word_DocPrint and finally close with _Word_DocClose and kill word with _Word_Quit. Works perfectly.
My question is (can't find an answer anywhere): Can i do those commands in the background so i don't see word opening and replacing everything? Can't find anything in the proprieties of "WordDocOpen".
Wordperfect conversion to Word
Trying to find a quick way to convert 30k+ WordPerfect files into Word.
Will probably run it locally from an admin machine or server so user permissions won't affect it.
My idea was just to open the file, select all, copy, open new word doc, paste, file, save....
What would be the best way to go about scripting something in this way?
Word - Insert a row in table
I am struggling to insert a row in a table in a Word document.
$oDoc = _Word_DocAttach($oWord,"test.docx","FileName") $vRange = $oDoc.Tables(1).Rows(1).Select ; <-- ok - does select $vRange.Selection.InsertRowsBelow ; fails The documentation I have is (VBA) :-
ActiveDocument.Tables(1).Rows(2).Select Selection.InsertRowsBelow I do not know why the autoscript is failing on this line
$vRange.Selection.InsertRowsBelow I cannot specify
Selection.InsertRowsBelow as the statement does not compile.
Word Office - moveStart
I cannot get the method movestart to work in my program
$oRange = _Word_DocFind($oDoc, "3 4") ; return a range $oRange.MoveStart($WdLine,-1) ; supposed to move the start range to the beginning of the line I get an error '... requested action with this object has failed.'
I have seen this statement used in Word.Udf, but cannot see why my statement is failing.