The information in this article applies to:
SYMPTOMSWhen you use the Shell function in one of the Microsoft Office 98 programs listed at the beginning of this article, the application may not receive focus or may be restored to its original size and position. CAUSEThis problem may occur when the Shell function calls a program that is already open. WORKAROUNDMicrosoft 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 the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.aspTo work around this behavior, use either of the following methods. Method 1: ActivateMicrosoftApp methodIf you are trying to set focus to a Microsoft application, modify the macro to use the ActivateMicrosoftApp method. If the application is already running, this method switches to the running application. If the application is not running, this method starts a new instance of the application.
Method 2: AppActivate methodIf you are trying to set focus to a non-Microsoft application, modify the macro to use the AppActivate statement. The AppActivate statement changes the focus to the named application or window but does not affect if it is maximized or minimized. However, if the application is not running, this statement should be used in conjunction with the Shell function. For example, if the non-Microsoft application is SimpleText, the necessary code would be:
NOTE: Pathname is the path to the file or application. For example
where <Harddisk> is the name of you hard disk
drive and <test> is the name of the file you wish to set focus to.
STATUS
Microsoft has confirmed this to be a problem in the products listed at the
beginning of this article.
REFERENCES
For more information about the Shell function, from the Visual Basic
Editor, click the Office Assistant, type "Shell", click Search, and then
click to view "Shell Function".
Q176476 OFF: Office Assistant Not Answering Visual Basic Questions Additional query words: XL98 OFF98 PP98 WD98
Keywords : kbdta |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |