KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Mysterious scripting error: Object var is 'Nothing'
Topic Summary: Can't see what I've done wrong in three lines of code
Created On: 01/31/2016 09:01 AM
Status: Post and Reply
Linear : Threading : Single : Branch
 Mysterious scripting error: Object var is 'Nothing'   - loris - 01/31/2016 09:01 AM  
 Mysterious scripting error: Object var is 'Nothing'   - speechpro - 01/31/2016 09:51 AM  
 Mysterious scripting error: Object var is 'Nothing'   - loris - 01/31/2016 10:26 AM  
 Mysterious scripting error: Object var is 'Nothing'   - wristofdoom - 01/25/2023 01:01 PM  
 Mysterious scripting error: Object var is 'Nothing'   - speechpro - 01/29/2023 05:15 PM  
 Mysterious scripting error: Object var is 'Nothing'   - wristofdoom - 01/30/2023 05:49 PM  
 Mysterious scripting error: Object var is 'Nothing'   - speechpro - 01/30/2023 08:52 PM  
 Mysterious scripting error: Object var is 'Nothing'   - kkkwj - 01/25/2023 05:07 PM  
 Mysterious scripting error: Object var is 'Nothing'   - wristofdoom - 01/29/2023 01:49 PM  
 Mysterious scripting error: Object var is 'Nothing'   - kkkwj - 01/30/2023 11:30 AM  
 Mysterious scripting error: Object var is 'Nothing'   - wristofdoom - 01/30/2023 05:43 PM  
 Mysterious scripting error: Object var is 'Nothing'   - R. Wilke - 01/30/2023 11:45 AM  
 Mysterious scripting error: Object var is 'Nothing'   - Matt_Chambers - 01/31/2023 07:57 AM  
 Mysterious scripting error: Object var is 'Nothing'   - kkkwj - 01/31/2023 09:03 PM  
Keyword
 01/31/2016 09:01 AM
User is offline View Users Profile Print this message


loris
Senior Member

Posts: 102
Joined: 10/04/2009

I have three simple lines of code, and they're not running. Here they are:

Sub Main
    Selection = Trim(Selection)
    Selection.InsertBefore "("
    Selection.InsertAfter ") "
End Sub

This started as a Word macro. Works just dandy in Word. When I transfer it to Advanced Scripting—after having converted it using the Word 2016 reference—it throws the following error:

(10094) ActiveX Automation: Object var is 'Nothing'. (at line 4 Position 0)

Given that it does exactly what I want as a Word macro, I could of course make the Dragon macro simply call the word keystroke. But I'd rather do the right thing. What is turning my selection into "Nothing"?

Anyone know?

Thanks,

LS



-------------------------

loris


Win 10, DPI 14, KnowBrainer 2017



Statistics
32528 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 0 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 377 guests browsing this forum, which makes a total of 377 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2023 FuseTalk™ Inc. All rights reserved.