Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 13th, 2015, 12:06 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default Opening Word Document for Spelling Check using JS

I am converting a VBS to JS. Called by a button click, it opens Word, invokes the spelling checker, passes the text to Word, and returns the corrected text to the text field being checked. It worked just fine in VBS, but I've run into a problem with this JS line:

oDoc = oWord.Documents.Add( , , 1, true);

The first two empty parms causes a "undefined function" error before it even tries to run the script. It at least tries to run the script if I change those parameters to null:

oDoc = oWord.Documents.Add(null, null, 1, true);

But that throws a "Type mismatch" error.

The method clearly didn't care about those parms when called by VBS. Isn't there some way to tell it to ignore them when called by JS? I can't find any useful examples using JS, leading another developer to believe JS simply can't do it.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening word document Hannibal Need help with your homework? 0 March 9th, 2010 07:00 AM
Opening word document read only in VB StevenVints VB How-To 1 May 3rd, 2006 09:52 AM
ASP/JS Button opening a new window dilbert ASP.NET 2.0 Basics 3 December 23rd, 2005 01:20 PM
Access 97 and opening a Word document Andrew Antoniak Access VBA 1 June 11th, 2004 12:29 PM
Opening a MS Word document from ASP saturdave Classic ASP Basics 0 May 25th, 2004 01:47 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.