Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript & MS Word

Status
Not open for further replies.

JamieHart

Programmer
Sep 13, 2000
1
GB
Hello,

Is it possible to control MS word via Javascript/VB Script?

I can do it in ASP but it opens word on the server, I need it to open a local copy of word.

Thanks for any help :)
 
Jamie,

You can do this with WSH (Windows Scripting Host). I believe it only works in IE and works best with VBScript though Javascript can work as well (object based). Here is a simple example...

Code:
<script language=&quot;vbscript&quot;>
Dim WshShell
Set WshShell = CreateObject(&quot;Wscript.shell&quot;) 
WshShell.Run (&quot;winword.exe&quot;) 
</script>

Alot of the VBA (Visual Basic for Applications) ideaology should work here. You should be able to create docs, modify docs, run macros, ets. Get yourself a good WSH book.

Good luck, [sig]<p>Rob<br><a href=mailto:robschultz@yahoo.com>robschultz@yahoo.com</a><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
"Focus on the solution to the problem,<br>
not the obstacles in the way."<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top