IPB

Welcome Guest ( Log In | Register )


 
Reply to this topicStart new topic
> Designating Word Macro?
jnuttallphd
post Sep 22 2003, 04:05 AM
Post #1


Member
***

Group: Members
Posts: 832
Joined: 21-April 02
Member No.: 543



I am following the procedure in Larry Allen's book on Scripting for connecting voice command to Microsoft Word macros, e.g. macro called DefaultFont.

Sub Main
Word.Application.Run "DefaultFont"
EndSub

I'm also connecting to the --
Microsoft Word 9.0 Object Library (for Word-2000)

My problem is that I get a "Syntax error" message. So command will not complete or be saved. Any help and advice would be appreciated.

Jim


--------------------
Jim -- Michigan
Go to the top of the page
 
+Quote Post
Larry Allen
post Sep 22 2003, 04:18 AM
Post #2


Member
***

Group: Members
Posts: 459
Joined: 15-May 03
From: Phoenix Arizona
Member No.: 1,104



Possibilities:

1) I copied the macro from your message. There was no space between "End" and "Sub", causing a syntax error. In this case, it also showed "unexpected end of file" in the bottom part of the script window.
2) If you see "not an object reference" then the association/reference to the Word object library is not correct. Right-click while on the "Word.Application.Run..." line, select References, and verify the MS Word Object Library 9.0 is checked.
3) If you copied the macro from a Word document, then check the double-quote characters. The slanted ones that look pretty and that Word uses aren't correct -- type over the double-quote characters in the script box and you'll get the correct straight double-quotes.
4) TBD... this is part of the pain of macro development :-)

Larry Allen


--------------------
Larry Allen
http://www.pcspeak.com
Author, "Scripting for Dragon NaturallySpeaking 9"
Go to the top of the page
 
+Quote Post
jnuttallphd
post Sep 22 2003, 04:51 AM
Post #3


Member
***

Group: Members
Posts: 832
Joined: 21-April 02
Member No.: 543



Thanks Larry --

I didn't notice the problem between the "End" and "Sub". That corrected the situation. Now I can easily call up by Word macros. I'm learning more about writing Word macros. Quite handy.

Thanks again -- Jim


--------------------
Jim -- Michigan
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th June 2013 - 03:21 AM

We Recommend Using Dragon Medical and Dragon NaturallySpeaking Speech Recognition Software

Physicians Using Dragon Medical - Looking for the Best Electronic Health Record (EHR / EMR)?