lukeneo Posted August 9, 2006 Posted August 9, 2006 $Word = ObjCreate("Word.Application") $Word.Documents.Open(@ScriptDir & "\test.doc") ; code to append a text at the end of the document ; .... code ??? $Word.Activedocument.Save() ;$Word.Activedocument.Close $Word.quit $Word=""
Xenobiologist Posted August 9, 2006 Posted August 9, 2006 (edited) HI,have a look in the S&S forum. I think bigDaddy made something for that. WordSo long,Mega Edited August 9, 2006 by th.meger 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
lukeneo Posted August 9, 2006 Author Posted August 9, 2006 HI,have a look in the S&S forum. I think bigDaddy made something for that. WordSo long,MegaA beat Closer : This code adds text to the document , but at the beginning ....I want to add to the end of the document ....Anyone ....with some idea ?$Word = ObjCreate("Word.Application")$Word.Documents.Open(@ScriptDir & "\test.doc")$word.Selection.TypeText( "zip code 123456789 " )$word.Selection.Font.Bold = True$word.Selection.TypeText( "" )$word.Selection.Font.Bold = False$word.Selection.TypeText( "." )$Word.Activedocument.Save();$Word.Activedocument.Close$Word.quit$Word=""
Moderators big_daddy Posted August 9, 2006 Moderators Posted August 9, 2006 As of right now this is the best solution I have.Requires:Word.au3 - See my signature for link#include <Word.au3> _WordErrorHandlerRegister() $sFilePath = @ScriptDir & "\test.doc" $sText1 = "zip code 123456789 " $sText2 = "." $oWordApp = _WordCreate($sFilePath) $oDoc = $oWordApp.ActiveDocument $oRng1 = $oDoc.Range $oRng1.InsertAfter ($sText1) $iEnd = $oRng1.End $oRng2 = $oDoc.Range($iEnd-StringLen($sText1), $iEnd) $oRng2.Font.Bold = True $oRng2.InsertAfter ($sText2) $iEnd = $oRng2.End $oRng3 = $oDoc.Range($iEnd-StringLen($sText2), $iEnd) $oRng2.Font.Bold = False _WordDocumentSave($oDoc) _WordQuit($oWordApp)
autosc Posted August 10, 2006 Posted August 10, 2006 As of right now this is the best solution I have. Requires: Word.au3 - See my signature for link #include <Word.au3> _WordErrorHandlerRegister() $sFilePath = @ScriptDir & "\test.doc" $sText1 = "zip code 123456789 " $sText2 = "." $oWordApp = _WordCreate($sFilePath) $oDoc = $oWordApp.ActiveDocument $oRng1 = $oDoc.Range $oRng1.InsertAfter ($sText1) $iEnd = $oRng1.End $oRng2 = $oDoc.Range($iEnd-StringLen($sText1), $iEnd) $oRng2.Font.Bold = True $oRng2.InsertAfter ($sText2) $iEnd = $oRng2.End $oRng3 = $oDoc.Range($iEnd-StringLen($sText2), $iEnd) $oRng2.Font.Bold = False _WordDocumentSave($oDoc) _WordQuit($oWordApp) Thanks Big Daddy ! it works ! How can i do it with silent mode ? without opening word ? Yours Library are excellent which i did not know existed . I hope you will complete everything .
Moderators big_daddy Posted August 10, 2006 Moderators Posted August 10, 2006 Thanks Big Daddy ! it works ! How can i do it with silent mode ? without opening word ? Yours Library are excellent which i did not know existed . I hope you will complete everything .You still have to open word, but you can open it hidden. Change: $oWordApp = _WordCreate($sFilePath)oÝ÷ Ù:ºÚ"µÍÌÍÛÕÛÜHÕÛÜÜX]J ÌÍÜÑ[T]
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