KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Advanced Scripting VBA Reference Imacros
Topic Summary:
Created On: 09/14/2021 04:45 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 Advanced Scripting VBA Reference Imacros   - Smower - 09/14/2021 04:45 PM  
 Advanced Scripting VBA Reference Imacros   - Mav - 09/15/2021 02:40 AM  
 Advanced Scripting VBA Reference Imacros   - Smower - 09/15/2021 09:39 AM  
Keyword
 09/14/2021 04:45 PM
User is offline View Users Profile Print this message

Author Icon
Smower
New Member

Posts: 5
Joined: 02/28/2014

Hello experts,

Is it possible for me to put the following VBScript code into an Advanced Scripting command to get it to work from NaturallySpeaking commands? Every time I try I get an error on line 3

Option Explicit
Dim iim, status
Set iim= CreateObject ("imacros")
status = iim.iimOpen("")
Dim macro
macro = "TAG POS=2 TYPE=SPAN FORM=ACTION:. ATTR=TXT:""General merchandise""" + vbNewLine
macro = macro + "TAG POS=R1 TYPE=INPUT:TEXT FORM=ACTION:. ATTR=NAME:* CONTENT=123456" + vbNewLine
status = iim.iimPlayCode(macro)

Thank you,

Shawn

 09/15/2021 02:40 AM
User is offline View Users Profile Print this message

Author Icon
Mav
Top-Tier Member

Posts: 440
Joined: 10/02/2008

Hi!

You seem to have forgotten the declaration of your Sub Main.

Try this code:

Option Explicit

Sub Main
    Dim iim, status
    Set iim= CreateObject ("imacros")
    status = iim.iimOpen("")
    Dim macro
    macro = "TAG POS=2 TYPE=SPAN FORM=ACTION:. ATTR=TXT:""General merchandise""" + vbNewLine
    macro = macro + "TAG POS=R1 TYPE=INPUT:TEXT FORM=ACTION:. ATTR=NAME:* CONTENT=123456" + vbNewLine
    status = iim.iimPlayCode(macro)
End Sub

hth
mav
 09/15/2021 09:39 AM
User is offline View Users Profile Print this message

Author Icon
Smower
New Member

Posts: 5
Joined: 02/28/2014

That fixed it! Thank you!
Statistics
32177 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 315 guests browsing this forum, which makes a total of 315 users using this forum.

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