LukeJrs Posted August 23, 2007 Share Posted August 23, 2007 The following help I need is words. It collect picture from windows folder but can I have it to instead of addpicture comamnd paste the picture i capture with then save it, now what if file does exists? Can it be opened then add more picture on next line without earing all picture added previewsly? CODE ; ******************************************************* ; Example 1 - Create a word window with a new blank document, ; then add some pictures to the document. ; ******************************************************* ; #include <Word.au3> $sPath = @WindowsDir & "\" $search = FileFindFirstFile($sPath & "*.bmp") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No images found") Exit EndIf $oWordApp = _WordCreate () $oDoc = _WordDocGetCollection ($oWordApp, 0) While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $oShape = _WordDocAddPicture ($oDoc, $sPath & $file, 0, 1) If Not @error Then $oShape.Range.InsertAfter (@CRLF) WEnd ; Close the search handle FileClose($search) Link to comment Share on other sites More sharing options...
autocomplex Posted August 23, 2007 Share Posted August 23, 2007 ; ******************************************************* ; Example 1 - Create a word window with a new blank document, ; then add some pictures to the document. ; ******************************************************* ; #include <Word.au3> $sPath = @WindowsDir & "\" $search = FileFindFirstFile($sPath & "*.bmp") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No images found") Exit EndIf I dont fully understand what you are trying to do. Want Runescape Specific Scripts and Bots?Visit AutoIt Runescape Team (ARST) forum! Link to comment Share on other sites More sharing options...
autocomplex Posted August 23, 2007 Share Posted August 23, 2007 ... please elaborate. Want Runescape Specific Scripts and Bots?Visit AutoIt Runescape Team (ARST) forum! Link to comment Share on other sites More sharing options...
LukeJrs Posted August 23, 2007 Author Share Posted August 23, 2007 (edited) The script add picture that is located in windows into word document. Well I would like to hit PrintScreen and then paste in word document. then save it. Let hypothetically If there was a file exists like CODE If FileExists("D:\test.doc") Then _WordDocOpen (blah,blah.blah,codes,codes, "D:\test.doc") _WordDocAddPicture("^{V}") Else _WordCreate ("") _WordDocAddPicture("^{V}") and save as test.doc EndIf Let get to the point! I would like words to paste the printscreen i got on my clipboard also save it on words file automaticly..... If words doesn't exists then create one and save it automaticly if words does exists then open existen file then modify add new picture to words to the next line and save automaticly Edited August 23, 2007 by LukeJrs Link to comment Share on other sites More sharing options...
CrewXp Posted August 23, 2007 Share Posted August 23, 2007 Did you use a translator..... Link to comment Share on other sites More sharing options...
therks Posted August 23, 2007 Share Posted August 23, 2007 I think he's looking for an algorithm something like this... If Word document (test.doc) exists, open it, paste image from clipboard (from PrintScreen) into document, then save. Else, create new document, paste image from clipboard (from PrintScreen) into document, then save as test.doc. Something like that perhaps? And no, there's no way he used a translator, because there's no translator that would spell "automaticly" like that. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted August 23, 2007 Moderators Share Posted August 23, 2007 This should do what you need. #include <Word.au3> ;WdCollapseDirection Const $wdCollapseStart = 1 Const $wdCollapseEnd = 0 $sFilePath = @ScriptDir & "\ScreenCap.doc" _WordErrorHandlerRegister() $oWordApp = _WordCreate("", 0, 0) ; Open the specified word document or create it if it doesn't exist $oDoc = _WordDocOpen($oWordApp, $sFilePath) $oRange = $oDoc.Content $oRange.Collapse ($wdCollapseEnd) ; Capture the whole screen ;~ Send("{PRINTSCREEN}") ; Capture the active window Send("!{PRINTSCREEN}") $oRange.Paste _WordQuit($oWordApp, -1) Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted August 26, 2007 Moderators Share Posted August 26, 2007 Just wondering if this did what you needed? Link to comment Share on other sites More sharing options...
LukeJrs Posted September 12, 2007 Author Share Posted September 12, 2007 Thanks sorry for the long reply... yes it's what I was looking for to make it work. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted September 12, 2007 Moderators Share Posted September 12, 2007 Your welcome, glad it worked for 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