https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/170719&feed=atom&action=history
Microsoft KB Archive/170719 - Revision history
2024-03-29T00:46:07Z
Revision history for this page on the wiki
MediaWiki 1.39.3
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/170719&diff=343002&oldid=prev
X010: Text replacement - """ to """
2020-07-21T10:05:05Z
<p>Text replacement - """ to """</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en-GB">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 10:05, 21 July 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l49">Line 49:</td>
<td colspan="2" class="diff-lineno">Line 49:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre class="codesample"> Sub SendKeysExample()</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre class="codesample"> Sub SendKeysExample()</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> ChDir <del style="font-weight: bold; text-decoration: none;">&quot;</del>C:\My Documents<del style="font-weight: bold; text-decoration: none;">&quot; </del> ' Change Directory.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> ChDir <ins style="font-weight: bold; text-decoration: none;">"</ins>C:\My Documents<ins style="font-weight: bold; text-decoration: none;">" </ins> ' Change Directory.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Dialogs(wdDialogFileOpen).Show ' Show the FileOpen dialog.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Dialogs(wdDialogFileOpen).Show ' Show the FileOpen dialog.</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> SendKeys <del style="font-weight: bold; text-decoration: none;">&quot;</del>%A<del style="font-weight: bold; text-decoration: none;">&quot; </del>' ' Send the ALT+A keystroke.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> SendKeys <ins style="font-weight: bold; text-decoration: none;">"</ins>%A<ins style="font-weight: bold; text-decoration: none;">" </ins>' ' Send the ALT+A keystroke.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> End Sub</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> End Sub</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </pre></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </pre></div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l87">Line 87:</td>
<td colspan="2" class="diff-lineno">Line 87:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre class="codesample"> Sub SendKeysExample()</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre class="codesample"> Sub SendKeysExample()</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> ChDir <del style="font-weight: bold; text-decoration: none;">&quot;</del>C:\My Documents<del style="font-weight: bold; text-decoration: none;">&quot; </del> ' Change Directory.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> ChDir <ins style="font-weight: bold; text-decoration: none;">"</ins>C:\My Documents<ins style="font-weight: bold; text-decoration: none;">" </ins> ' Change Directory.</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> SendKeys <del style="font-weight: bold; text-decoration: none;">&quot;</del>%A<del style="font-weight: bold; text-decoration: none;">&quot; </del> ' Send the ALT+A keystroke.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> SendKeys <ins style="font-weight: bold; text-decoration: none;">"</ins>%A<ins style="font-weight: bold; text-decoration: none;">" </ins> ' Send the ALT+A keystroke.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Dialogs(wdDialogFileOpen).Show ' Show the FileOpen dialog.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Dialogs(wdDialogFileOpen).Show ' Show the FileOpen dialog.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> End Sub</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> End Sub</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l110">Line 110:</td>
<td colspan="2" class="diff-lineno">Line 110:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><br /></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><br /></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><br /></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><br /></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>For more information about SendKeys, from the Visual Basic for Applications Editor, click the Office Assistant, type <del style="font-weight: bold; text-decoration: none;">&quot;</del>SendKeys,<del style="font-weight: bold; text-decoration: none;">&quot; </del>click Search, and then click to view <del style="font-weight: bold; text-decoration: none;">&quot;</del>SendKeys Statement.<del style="font-weight: bold; text-decoration: none;">&quot;</del><br /></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>For more information about SendKeys, from the Visual Basic for Applications Editor, click the Office Assistant, type <ins style="font-weight: bold; text-decoration: none;">"</ins>SendKeys,<ins style="font-weight: bold; text-decoration: none;">" </ins>click Search, and then click to view <ins style="font-weight: bold; text-decoration: none;">"</ins>SendKeys Statement.<ins style="font-weight: bold; text-decoration: none;">"</ins><br /></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><br /></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><br /></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If Microsoft Help is not installed on your computer, please see the following article in the Microsoft Knowledge Base:<br /></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If Microsoft Help is not installed on your computer, please see the following article in the Microsoft Knowledge Base:<br /></div></td></tr>
</table>
X010
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/170719&diff=89998&oldid=prev
3155ffGd: importing KB archive
2020-07-18T15:35:23Z
<p>importing KB archive</p>
<p><b>New page</b></p><div><div id="nsbanner"><br />
<br />
<div id="bannerrow1"><br />
<br />
{|<br />
| Knowledge Base<br />
|<br />
|}<br />
<br />
<br />
</div><br />
<div id="TitleRow"><br />
<br />
= <span id="KB170719"></span>WD97: Using SendKeys with Dialog Boxes =<br />
<br />
<br />
</div><br />
<br />
</div><br />
<div id="nstext" valign="BOTTOM"><br />
<br />
Article ID: 170719<br />
<br />
Article Last Modified on 1/20/2007<br />
<br />
<br />
-----<br />
<br />
APPLIES TO<br /><br />
<br /><br />
<br />
* Microsoft Word 97 Standard Edition<br />
<br />
<br />
-----<br />
<br />
<div class="notice_section"><br />
<br />
This article was previously published under Q170719<br />
<br />
</div><br />
<div class="symptoms_section"><br />
<br />
== SYMPTOMS ==<br />
<br />
<br /><br />
When you use the '''SendKeys''' function after calling a dialog box, your macro does not run as expected. For example, the following macro does not run correctly:<br /><br />
<br /><br />
<br />
<pre class="codesample"> Sub SendKeysExample()<br />
ChDir &quot;C:\My Documents&quot; ' Change Directory.<br />
Dialogs(wdDialogFileOpen).Show ' Show the FileOpen dialog.<br />
SendKeys &quot;%A&quot; ' ' Send the ALT+A keystroke.<br />
End Sub<br />
</pre><br />
<br />
</div><br />
<div class="cause_section"><br />
<br />
== CAUSE ==<br />
<br />
Visual Basic for Applications processes code one line at a time. The '''SendKeys''' function sends the specified keys to the active application, just as if they were typed at the keyboard. If Word is not the active application, and if wait is set to -1, Word will wait for all the keys to be processed before proceeding.<br /><br />
<br /><br />
Whenever a Word dialog box is opened, it becomes the active foreground application and it is ready to take commands; it also must be terminated (with '''OK''' or '''Cancel''') before the next line can be processed.<br />
<br />
</div><br />
<div class="workaround_section"><br />
<br />
== WORKAROUND ==<br />
<br />
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:<br />
<div class="indent"><br />
<br />
https://partner.microsoft.com/global/30000104<br />
<br />
<br />
</div><br />
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:<br />
<div class="indent"><br />
<br />
[http://support.microsoft.com/default.aspx?scid=fh;en-us;cntactms http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS]<br />
<br />
<br />
</div><br />
In the example, the '''SendKeys''' command should come before the '''Dialogs''' command so that the '''FileOpen''' dialog box can process the keys and display the '''Advanced search''' dialog box. Then the next line of code can be processed.<br /><br />
<br /><br />
<br />
<pre class="codesample"> Sub SendKeysExample()<br />
ChDir &quot;C:\My Documents&quot; ' Change Directory.<br />
SendKeys &quot;%A&quot; ' Send the ALT+A keystroke.<br />
Dialogs(wdDialogFileOpen).Show ' Show the FileOpen dialog.<br />
End Sub<br />
</pre><br />
<br />
</div><br />
<div class="moreinformation_section"><br />
<br />
== MORE INFORMATION ==<br />
<br />
<br /><br />
<br /><br />
For additional information, see the following article or articles in the Microsoft Knowledge Base:<br /><br />
<br />
<div class="indent"><br />
<br />
[[../165078|165078]] WD97: Some Open Shortcuts Changed<br />
<br />
<br />
</div><br />
<br /><br />
<br /><br />
For more information about SendKeys, from the Visual Basic for Applications Editor, click the Office Assistant, type &quot;SendKeys,&quot; click Search, and then click to view &quot;SendKeys Statement.&quot;<br /><br />
<br /><br />
NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If Microsoft Help is not installed on your computer, please see the following article in the Microsoft Knowledge Base:<br /><br />
<br /><br />
For additional information, see the following article or articles in the Microsoft Knowledge Base:<br /><br />
<br />
<div class="indent"><br />
<br />
[[../120802|120802]] Office: How to Add/Remove a Single Office Program or Component<br />
<br />
<br />
</div><br />
<br />
</div><br />
<br /><br />
<br />
Additional query words: offcon wordcon vba vb vbe execute<br />
<br />
Keywords: kbdtacode kbmacro kbprb kbprogramming KB170719<br />
<br />
<div class="footer"><br />
<br />
<br /><br />
<br />
<br />
-----<br />
<br />
[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]<br />
<br />
<span>© Microsoft Corporation. All rights reserved.</span><br />
<br />
<br />
</div><br />
<br />
</div></div>
3155ffGd