Ahnungslos Posted July 26, 2006 Share Posted July 26, 2006 (edited) $Word = ObjCreat("Word.Application") $Word.Documents.Open(@ScriptDir & "\Vorlagen\Mahnung.doc") With $Word.Selection.Find .ClearFormatting .Replacement.ClearFormatting .Text = "%Ort%" .Replacement.Text = "Bad Blankenburg" .Forward = 1 .Wrap = 1 .Format = 0 .MatchCase = 0 .MatchWholeWord = 0 .MatchWildcards = 0 .MatchSoundsLike = 0 .MatchAllWordForms = 0 .Execute Replace: = 2 EndWith $Word.Activedocument.Save() $Word.Activedocument.Close In Zeile 16 nimmt AutoIt Replace: = 2 nicht an und in " " wird es von Word nicht angenommen. or: In line 16 AutoIt not take Replace: = 2 and in " " it is not accepted by Word. Edited July 26, 2006 by Ahnungslos Link to comment Share on other sites More sharing options...
/dev/null Posted July 26, 2006 Share Posted July 26, 2006 In line 16 AutoIt not take Replace: = 2 and in " " it is not accepted by Word.Try: .Execute(Replace=2)CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
randallc Posted July 26, 2006 Share Posted July 26, 2006 Hi, This works on my machine; ;replacedoc.au3 ;replacedoc.doc $Word = ObjCreate("Word.Application") $Word.Documents.Open(@ScriptDir & "\replacedoc mydoc.doc") With $Word.Selection.Find .ClearFormatting .Replacement.ClearFormatting ;~ expression.Execute(FindText, MatchCase, MatchWholeWord, MatchWildcards, &_ ;~ MatchSoundsLike, MatchAllWordForms, Forward, Wrap, Format, ReplaceWith, Replace,&_ ;~ MatchKashida, MatchDiacritics, MatchAlefHamza, MatchControl) .Execute("aaa", false, false, false, false, false, true, false, false, "bbb", 2) EndWith MsgBox(0,"","") $Word.Activedocument.Save() $Word.Activedocument.Close $Word.quit $Word=""Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 26, 2006 Share Posted July 26, 2006 Hi, never thought of using something like that, but I was interested and tested it. I noticed that the winword.exe doesn't close after the script has finished. Is that normal? So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
randallc Posted July 26, 2006 Share Posted July 26, 2006 Hi, $Word.quitworks for me; perhaps yours was still there after trying the original script on this thread, which did not have a "quit" instruction? Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Ahnungslos Posted July 27, 2006 Author Share Posted July 27, 2006 Thank You Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now