#174797 - 2007-03-21 12:02 AM
Re: SendKeys for Shift not working
[Re: Publius]
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Oh well Something to get you started
;************************************************************************* ; Script Name: ; Author: Publius ; Date: 20/03/2007 ; Description: Find "FRENCH STARTS HERE" ;*************************************************************************
;Script Opions If NOT @LOGONMODE Break On Else Break Off EndIf Dim $RC $RC = SetOption("Explicit", "On") $RC = SetOption("NoMacrosInStrings", "On") $RC = SetOption("NoVarsInStrings", "On") $RC = SetOption("WrapAtEOL", "On")
;Declare variables Dim $objWord, $strWordFile, $strFind $strWordFile = "\\Server\Share\Deeper\YourFile.doc" $strFind = "FRENCH STARTS HERE"
;Create Word object $objWord = CreateObject("Word.Application") If @ERROR ? "Error creating Word object" ? "Error " + @ERROR + ": " + @SERROR Quit @ERROR EndIf
;Open Word document ;Maybe you can do everything invisible and comment the next line $objWord.Visible = 1 $RC = $objWord.Documents.Open($strWordFile) $objWord.Selection.Find.Text = $strFind $RC = $objWord.Selection.Find.Execute
; Other stuff ; Complete your script
;Do not forget to close word if working invisible $RC = $objWord.Application.Quit |
The File/Open and the Find are easy to recreate if you just play a while with your macro recorder in Word. Just give it a try.
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 2160 anonymous users online.
|
|
|