A
anithakp
Hi,
I have written code to open a word document and format it through Windows
Scripting host SendKeys Method by activating word.The code is as below
Dim WshShell
Set objWord = WScript.CreateObject("Word.Application")
Set WshShell = CreateObject("WScript.Shell")
WScript.ConnectObject objWord, "objWord_"
objWord.visible = True
blnWordVisible = True
Set doc = objWord.Documents.Add("c:\\testfile.doc")
WshShell.AppActivate "Word"
WScript.Sleep 1000
WshShell.SendKeys "^a"
WScript.Sleep 1000
WshShell.SendKeys "^b"
WScript.Sleep 1000
WshShell.SendKeys "%o"
WScript.Sleep 1000
WshShell.SendKeys "F"
WScript.Sleep 1000
WshShell.SendKeys "%C"
WScript.Sleep 1000
WshShell.SendKeys "{DOWN}{DOWN}{RIGHT}"
WScript.Sleep 1000
WshShell.SendKeys "~"
WScript.Sleep 1000
WshShell.SendKeys
"{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "~"
WshShell.SendKeys "{RIGHT}"
For selection of Color and other properties the Font window appears. I
donot want to display the window to the end user and do the formatting.Is
there any way to do all these things by hiding the windows?
I have written code to open a word document and format it through Windows
Scripting host SendKeys Method by activating word.The code is as below
Dim WshShell
Set objWord = WScript.CreateObject("Word.Application")
Set WshShell = CreateObject("WScript.Shell")
WScript.ConnectObject objWord, "objWord_"
objWord.visible = True
blnWordVisible = True
Set doc = objWord.Documents.Add("c:\\testfile.doc")
WshShell.AppActivate "Word"
WScript.Sleep 1000
WshShell.SendKeys "^a"
WScript.Sleep 1000
WshShell.SendKeys "^b"
WScript.Sleep 1000
WshShell.SendKeys "%o"
WScript.Sleep 1000
WshShell.SendKeys "F"
WScript.Sleep 1000
WshShell.SendKeys "%C"
WScript.Sleep 1000
WshShell.SendKeys "{DOWN}{DOWN}{RIGHT}"
WScript.Sleep 1000
WshShell.SendKeys "~"
WScript.Sleep 1000
WshShell.SendKeys
"{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "~"
WshShell.SendKeys "{RIGHT}"
For selection of Color and other properties the Font window appears. I
donot want to display the window to the end user and do the formatting.Is
there any way to do all these things by hiding the windows?