<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>MSSpeech Forum : VBScript rookie problems</title>
  <link>https://www.msspeech-forum.com/</link>
  <description><![CDATA[This is an XML content feed of; MSSpeech Forum : Macros and Macro Development : VBScript rookie problems]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 03 May 2026 06:15:41 +0000</pubDate>
  <lastBuildDate>Sun, 01 Mar 2009 11:34:03 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.02</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>https://www.msspeech-forum.com/RSS_post_feed.asp?TID=65</WebWizForums:feedURL>
  <image>
   <title><![CDATA[MSSpeech Forum]]></title>
   <url>https://www.msspeech-forum.com/forum_images/msspeech_forum.png</url>
   <link>https://www.msspeech-forum.com/</link>
  </image>
  <item>
   <title><![CDATA[VBScript rookie problems : Nataniel,   Thanks for showing...]]></title>
   <link>https://www.msspeech-forum.com/vbscript-rookie-problems_topic65_post305.html#305</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.msspeech-forum.com/member_profile.asp?PF=75">russ</a><br /><strong>Subject:</strong> 65<br /><strong>Posted:</strong> 01/Mar/2009 at 11:34am<br /><br />Nataniel, <DIV>&nbsp;</DIV><DIV>Thanks for showing the way for me. I appreciate it!</DIV><DIV>&nbsp;</DIV><DIV>-Russ</DIV>]]>
   </description>
   <pubDate>Sun, 01 Mar 2009 11:34:03 +0000</pubDate>
   <guid isPermaLink="true">https://www.msspeech-forum.com/vbscript-rookie-problems_topic65_post305.html#305</guid>
  </item> 
  <item>
   <title><![CDATA[VBScript rookie problems : You were trying to use the &amp;#039;msg&amp;#039;...]]></title>
   <link>https://www.msspeech-forum.com/vbscript-rookie-problems_topic65_post295.html#295</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.msspeech-forum.com/member_profile.asp?PF=90">antihadron</a><br /><strong>Subject:</strong> 65<br /><strong>Posted:</strong> 27/Feb/2009 at 2:18am<br /><br /><br>You were trying to use the 'msg' attribute off of 'objOutlook' (does not exist).<br><br>&nbsp;This should point you in the right direction. This displays the first attachment off of the first selected message.<br><br>Dim att2, msg, attachmentname, objWshObject, objOutlook,strFolderpath,strFile<br><br>&nbsp;Set objOutlook = CreateObject("Outlook.Application")<br>&nbsp;&nbsp;&nbsp; Set objWshObject = CreateObject("WScript.Shell")<br><br>'Pops up the 1st selected message can use ActiveInspecter.CurrentItem as well<br>&nbsp;&nbsp;&nbsp; Set msg = objOutlook.ActiveExplorer.Selection.Item(1)<br>&nbsp;&nbsp;&nbsp; msg.Display<br>'Saves attachment and launches according to file type registration...<br>'TODO-Use number passed in...<br>&nbsp;&nbsp;&nbsp; msg.Attachments.Item(1).SaveAsFile "c:/Temp/" &amp;&nbsp; msg.Attachments.Item(1).FileName<br>&nbsp;&nbsp;&nbsp; objWshObject.run("c:/Temp/" &amp;&nbsp; msg.Attachments.Item(1).FileName)<br>'Delete Item when done? &nbsp;&nbsp; <br><br><br>Hope this helps,<br><br>Nathaniel<br>http://www.thevoicesoftware.com<br><br><br>]]>
   </description>
   <pubDate>Fri, 27 Feb 2009 02:18:37 +0000</pubDate>
   <guid isPermaLink="true">https://www.msspeech-forum.com/vbscript-rookie-problems_topic65_post295.html#295</guid>
  </item> 
  <item>
   <title><![CDATA[VBScript rookie problems : Hello, I&amp;#039;ve been using Dragon...]]></title>
   <link>https://www.msspeech-forum.com/vbscript-rookie-problems_topic65_post289.html#289</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.msspeech-forum.com/member_profile.asp?PF=75">russ</a><br /><strong>Subject:</strong> 65<br /><strong>Posted:</strong> 21/Feb/2009 at 6:41pm<br /><br /><P>Hello,</P><P>I've been using Dragon NaturallySpeaking for a number of years now, and I recently started experimenting with WSR and its macro capability. I've managed to make a few XML-based macros with the help of Brad's extremely helpful "User's Guide," and over the last few days I've been trying to learn how to use VBScript within macros. I picked up a beginner's VBScript programming book at the library, read the first 100 pages, and thought I'd try modifying the following DNS command to work as a VBScript macro with WSR. The command opens an Outlook 2007 attachment by its number. I didn't write the command; I got it from another speech recognition forum and modified it to work the way I want it to. Here's the VBA code:</P><P>Sub Main<BR>&nbsp;&nbsp;&nbsp; Dim Att As Attachment<BR>&nbsp;&nbsp;&nbsp; Dim msg As MailItem<BR>&nbsp;&nbsp;&nbsp; Dim attachmentname As String</P><P>&nbsp;&nbsp; &nbsp;SendKeys "^o",1&nbsp;&nbsp;'open the mail message</P><P>&nbsp;&nbsp;&nbsp; Set msg = ActiveInspector.CurrentItem<BR>&nbsp;&nbsp;&nbsp; Set Att = msg.Attachments.Item(CInt(ListVar1))<BR>&nbsp;&nbsp;&nbsp; attachmentname = Environ$("TEMP") + "/" + Att.FileName<BR>&nbsp;&nbsp;&nbsp; Att.SaveAsFile(attachmentname)</P><P>&nbsp;&nbsp;&nbsp; SendKeys "%{F4}"&nbsp;'close the mail message</P><P>&nbsp;&nbsp; &nbsp;ShellExecute attachmentname, 1, "", "Attachment"<BR>&nbsp;&nbsp;&nbsp; Set msg=Nothing<BR>&nbsp;&nbsp;&nbsp; Set Att=Nothing<BR>End Sub</P><P>I rewrote the code as shown below. The first problem I encountered was that my attempts (now commented out) to instantiate the WScript.Shell object resulted in the error, "Object required: WScript." It seems like a really basic command like that ought to work on my Vista Business system. Is there something else I'm supposed to install on my computer before I attempt to write, run, and debug VBScripts?</P><P>So I commented out the two WScript.Shell lines and kept going. (I later found out that I can use Application.SendKeys instead of the WshShell object's SendKeys statement, so maybe I won't need to instantiate this object anyway.) The next error I got was for the "msg = objOutlook.ActiveInspector.CurrentItem" line, as follows:</P><P>&nbsp;Object doesn't support this property or method: 'msg'</P><P>Again, this statement seems pretty straightforward. I get the feeling like there's something missing that out to have installed first before I started trying to write VBScripts. Any advice? Thanks.</P><P>-Russ</P><P>&lt;command&gt;<BR>&lt;listenFor&gt;open attachment &#091;AttachNum&#093;&lt;/listenFor&gt;<BR>&lt;script language="VBScript"&gt;&nbsp;<BR>&lt;!&#091;CDATA&#091;<BR>Dim Att, msg, attachmentname, objWshObject, objOutlook</P><P>&nbsp;&nbsp;&nbsp; Set objOutlook = GetObject(, "Outlook.Application")<BR>&nbsp;&nbsp;&nbsp; 'Set objWshObject = GetObject(, "WScript.Shell")<BR>&nbsp;&nbsp;&nbsp; 'Set objWshObject = WScript.CreateObject("WScript.Shell")</P><P>&nbsp;&nbsp;&nbsp; Application.SendKeys("{{CTRL}}o")&nbsp;'open the mail message</P><P>&nbsp;&nbsp;&nbsp; msg = objOutlook.ActiveInspector.CurrentItem<BR>&nbsp;&nbsp;&nbsp; Att = objOutlook.msg.Attachments.Item(CInt({&#091;AttachNum&#093;}))<BR>&nbsp;&nbsp;&nbsp; attachmentname = objWshObject.ExpandEnvironmentStrings("TEMP") &amp; "/" &amp; Att.FileName<BR>&nbsp;&nbsp;&nbsp; Application.Att.SaveAsFile(attachmentname)</P><P>&nbsp;&nbsp;&nbsp; Application.SendKeys("{{ALT}}{F4}")&nbsp;&nbsp;'close the mail message</P><P>&nbsp;&nbsp;&nbsp; ShellExecute attachmentname, 1, "", "Attachment"&nbsp;'need to find VBScript command equivalent<BR>&nbsp;&nbsp;&nbsp; msg=Nothing<BR>&nbsp;&nbsp;&nbsp; Att=Nothing<BR>&#093;&#093;&gt;<BR>&lt;/script&gt;<BR>&lt;/command&gt;<BR>&lt;numbers name="AttachNum" start="1" stop="9"/&gt;<BR></P>]]>
   </description>
   <pubDate>Sat, 21 Feb 2009 18:41:56 +0000</pubDate>
   <guid isPermaLink="true">https://www.msspeech-forum.com/vbscript-rookie-problems_topic65_post289.html#289</guid>
  </item> 
 </channel>
</rss>