<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TechBlog &#187; Windows Script Host Object Model</title>
	<atom:link href="http://techblog.byllemos.com/tag/windows-script-host-object-model/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.byllemos.com</link>
	<description>Accelerating into the Future with Wisdom about Technology! Ingrid Byllemos</description>
	<lastBuildDate>Tue, 05 Jan 2010 00:04:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Sendkeys in Navision</title>
		<link>http://techblog.byllemos.com/2008/01/sendkeys-in-navision/</link>
		<comments>http://techblog.byllemos.com/2008/01/sendkeys-in-navision/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 22:45:50 +0000</pubDate>
		<dc:creator>iby</dc:creator>
				<category><![CDATA[Automations]]></category>
		<category><![CDATA[Navision]]></category>
		<category><![CDATA[Sendkeys]]></category>
		<category><![CDATA[Windows Script Host Object Model]]></category>
		<category><![CDATA[WshShell]]></category>

		<guid isPermaLink="false">http://techblog.byllemos.com/?p=6</guid>
		<description><![CDATA[<p>With SendKeys you simulate user keystrokes &#8211; which mean it is possible to start applications, enter information, choose menus, buttons etc.</p>
<p>SendKeys is a part of Windows Script Host.</p>
<p>Currently I am using this functionality to take over a second&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>With SendKeys you simulate user keystrokes &#8211; which mean it is possible to start applications, enter information, choose menus, buttons etc.</p>
<p>SendKeys is a part of Windows Script Host.</p>
<p>Currently I am using this functionality to take over a second Navision Client, to start an export of objects without any user interventions.</p>
<p><span id="more-6"></span></p>
<p>In Navision SendKeys are found in the automation <em>Windows Script Host Object Model</em> class <em>WshShell</em>.</p>
<p>The first thing to do is to create the automation:</p>
<blockquote><p>IF ISCLEAR(WshShell) THEN<br />
<blankspace>&#8230;..</blankspace>CREATE(WshShell);</p></blockquote>
<p>Activate the application which has to behandled:</p>
<blockquote><p>WshShell.AppActivate(AppName);</p></blockquote>
<p>And then send the keys:</p>
<blockquote><p>WaitForKeys := TRUE;</p>
<p>WshShell.SendKeys(&#8216;{ESC 2}&#8217;,WaitForKeys);<br />
WshShell.SendKeys(&#8216;{DOWN}&#8217;,WaitForKeys);<br />
WshShell.SendKeys(&#8216;{LEFT}&#8217;,WaitForKeys);<br />
WshShell.SendKeys(&#8216;Ver{ENTER}&#8217;,WaitForKeys);</p></blockquote>
<p>When you are finished sending keys then stop the automation by clearing it:</p>
<blockquote><p>CLEAR(WshShell);</p></blockquote>
<p>Pretty simple – right <img src='http://techblog.byllemos.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.byllemos.com/2008/01/sendkeys-in-navision/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

