473,418 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

What is up with the Shell command here?

Hi folks,

In an A2K app, I have attempted to use the following command in some
VBA code with IDENTICAL results with every single version of the
following:

Shell "outlook.exe", vbHide
Shell "outlook.exe", vbNormalFocus
Shell "outlook.exe", vbMinimizedFocus
Shell "outlook.exe", vbMaximizedFocus
Shell "outlook.exe", vbNormalNoFocus
Shell "outlook.exe", vbMinimizedNoFocus

In every instance above, Outlook loads and shows me the Outlook window
and just stays there! All I want to do is to load Outlook in the
background and stay focused on the form that I was on when the command
was issued.

IOW -- the command arguments simply do not work as documented. Anyone
have a clue what I'm overlooking?

Thanks in advance.

-- LW
Nov 13 '05 #1
6 10014
On Sat, 19 Mar 2005 18:52:05 -0600, Lauren Wilson <pr*****@nospam.com>
wrote:

Apparently Outlook is trying to be too helpful, thinking it knows
best.
Perhaps you can use the BringWindowToTop API to set focus back to
where you want it.

-Tom.

Hi folks,

In an A2K app, I have attempted to use the following command in some
VBA code with IDENTICAL results with every single version of the
following:

Shell "outlook.exe", vbHide
Shell "outlook.exe", vbNormalFocus
Shell "outlook.exe", vbMinimizedFocus
Shell "outlook.exe", vbMaximizedFocus
Shell "outlook.exe", vbNormalNoFocus
Shell "outlook.exe", vbMinimizedNoFocus

In every instance above, Outlook loads and shows me the Outlook window
and just stays there! All I want to do is to load Outlook in the
background and stay focused on the form that I was on when the command
was issued.

IOW -- the command arguments simply do not work as documented. Anyone
have a clue what I'm overlooking?

Thanks in advance.

-- LW


Nov 13 '05 #2
On Sat, 19 Mar 2005 18:17:41 -0700, Tom van Stiphout
<no*************@cox.net> wrote:

Please forgive my ignorance -- BringWindowToTop API?
Where is that?

On Sat, 19 Mar 2005 18:52:05 -0600, Lauren Wilson <pr*****@nospam.com>
wrote:

Apparently Outlook is trying to be too helpful, thinking it knows
best.
Perhaps you can use the BringWindowToTop API to set focus back to
where you want it.

-Tom.

Hi folks,

In an A2K app, I have attempted to use the following command in some
VBA code with IDENTICAL results with every single version of the
following:

Shell "outlook.exe", vbHide
Shell "outlook.exe", vbNormalFocus
Shell "outlook.exe", vbMinimizedFocus
Shell "outlook.exe", vbMaximizedFocus
Shell "outlook.exe", vbNormalNoFocus
Shell "outlook.exe", vbMinimizedNoFocus

In every instance above, Outlook loads and shows me the Outlook window
and just stays there! All I want to do is to load Outlook in the
background and stay focused on the form that I was on when the command
was issued.

IOW -- the command arguments simply do not work as documented. Anyone
have a clue what I'm overlooking?

Thanks in advance.

-- LW


Nov 13 '05 #3
On Sat, 19 Mar 2005 21:25:11 -0600, Lauren Wilson <pr*****@nospam.com>
wrote:
It's a Windows API call.

Put this in a module:
Public Declare Function BringWindowToTop Lib "user32" Alias
"BringWindowToTop" (ByVal hwnd As Long) As Long

Then call it using code like:
Shell "outlook.exe", vbNormalNoFocus 'no focus does not work.
BringWindowToTop Application.hWndAccessApp 'bring my Access app back
to the foreground

-Tom.

On Sat, 19 Mar 2005 18:17:41 -0700, Tom van Stiphout
<no*************@cox.net> wrote:

Please forgive my ignorance -- BringWindowToTop API?
Where is that?

On Sat, 19 Mar 2005 18:52:05 -0600, Lauren Wilson <pr*****@nospam.com>
wrote:

Apparently Outlook is trying to be too helpful, thinking it knows
best.
Perhaps you can use the BringWindowToTop API to set focus back to
where you want it.

-Tom.

Hi folks,

In an A2K app, I have attempted to use the following command in some
VBA code with IDENTICAL results with every single version of the
following:

Shell "outlook.exe", vbHide
Shell "outlook.exe", vbNormalFocus
Shell "outlook.exe", vbMinimizedFocus
Shell "outlook.exe", vbMaximizedFocus
Shell "outlook.exe", vbNormalNoFocus
Shell "outlook.exe", vbMinimizedNoFocus

In every instance above, Outlook loads and shows me the Outlook window
and just stays there! All I want to do is to load Outlook in the
background and stay focused on the form that I was on when the command
was issued.

IOW -- the command arguments simply do not work as documented. Anyone
have a clue what I'm overlooking?

Thanks in advance.

-- LW


Nov 13 '05 #4
On Sat, 19 Mar 2005 20:53:10 -0700, Tom van Stiphout
<no*************@cox.net> wrote:

Thanks a LOT Tom.

Well, I tried this. The code executes just fine but it makes no
difference whatsoever -- Outlook doesn't even flicker -- it just stays
on top. Go figure.

Anyone else have a clue why this is happening?
On Sat, 19 Mar 2005 21:25:11 -0600, Lauren Wilson <pr*****@nospam.com>
wrote:
It's a Windows API call.

Put this in a module:
Public Declare Function BringWindowToTop Lib "user32" Alias
"BringWindowToTop" (ByVal hwnd As Long) As Long

Then call it using code like:
Shell "outlook.exe", vbNormalNoFocus 'no focus does not work.
BringWindowToTop Application.hWndAccessApp 'bring my Access app back
to the foreground

-Tom.

On Sat, 19 Mar 2005 18:17:41 -0700, Tom van Stiphout
<no*************@cox.net> wrote:

Please forgive my ignorance -- BringWindowToTop API?
Where is that?

On Sat, 19 Mar 2005 18:52:05 -0600, Lauren Wilson <pr*****@nospam.com>
wrote:

Apparently Outlook is trying to be too helpful, thinking it knows
best.
Perhaps you can use the BringWindowToTop API to set focus back to
where you want it.

-Tom.
Hi folks,

In an A2K app, I have attempted to use the following command in some
VBA code with IDENTICAL results with every single version of the
following:

Shell "outlook.exe", vbHide
Shell "outlook.exe", vbNormalFocus
Shell "outlook.exe", vbMinimizedFocus
Shell "outlook.exe", vbMaximizedFocus
Shell "outlook.exe", vbNormalNoFocus
Shell "outlook.exe", vbMinimizedNoFocus

In every instance above, Outlook loads and shows me the Outlook window
and just stays there! All I want to do is to load Outlook in the
background and stay focused on the form that I was on when the command
was issued.

IOW -- the command arguments simply do not work as documented. Anyone
have a clue what I'm overlooking?

Thanks in advance.

-- LW


Nov 13 '05 #5
On Sat, 19 Mar 2005 23:15:17 -0600, Lauren Wilson <pr*****@nospam.com>
wrote:

Probably because Shell is an asynchronous call. It's a "shoot and
forget" kind of function call. Outlook will materialize many
milliseconds after the call is made, and well after the next call to
BringWindowToTop is executed.

Try this:
Shell "outlook.exe", vbNormalNoFocus
Me.TimerInterval = 500

Private Sub Form_Timer()
Me.TimerInterval=0 'stop timer
BringWindowToTop Application.hWndAccessApp
End Sub

-Tom.
On Sat, 19 Mar 2005 20:53:10 -0700, Tom van Stiphout
<no*************@cox.net> wrote:

Thanks a LOT Tom.

Well, I tried this. The code executes just fine but it makes no
difference whatsoever -- Outlook doesn't even flicker -- it just stays
on top. Go figure.

Anyone else have a clue why this is happening?
On Sat, 19 Mar 2005 21:25:11 -0600, Lauren Wilson <pr*****@nospam.com>
wrote:
It's a Windows API call.

Put this in a module:
Public Declare Function BringWindowToTop Lib "user32" Alias
"BringWindowToTop" (ByVal hwnd As Long) As Long

Then call it using code like:
Shell "outlook.exe", vbNormalNoFocus 'no focus does not work.
BringWindowToTop Application.hWndAccessApp 'bring my Access app back
to the foreground

-Tom.

On Sat, 19 Mar 2005 18:17:41 -0700, Tom van Stiphout
<no*************@cox.net> wrote:

Please forgive my ignorance -- BringWindowToTop API?
Where is that?
On Sat, 19 Mar 2005 18:52:05 -0600, Lauren Wilson <pr*****@nospam.com>
wrote:

Apparently Outlook is trying to be too helpful, thinking it knows
best.
Perhaps you can use the BringWindowToTop API to set focus back to
where you want it.

-Tom.
>Hi folks,
>
>In an A2K app, I have attempted to use the following command in some
>VBA code with IDENTICAL results with every single version of the
>following:
>
>Shell "outlook.exe", vbHide
>Shell "outlook.exe", vbNormalFocus
>Shell "outlook.exe", vbMinimizedFocus
>Shell "outlook.exe", vbMaximizedFocus
>Shell "outlook.exe", vbNormalNoFocus
>Shell "outlook.exe", vbMinimizedNoFocus
>
>In every instance above, Outlook loads and shows me the Outlook window
>and just stays there! All I want to do is to load Outlook in the
>background and stay focused on the form that I was on when the command
>was issued.
>
>IOW -- the command arguments simply do not work as documented. Anyone
>have a clue what I'm overlooking?
>
>Thanks in advance.
>
>-- LW


Nov 13 '05 #6
Lauren Wilson <pr*****@nospam.com> wrote in
news:rs********************************@4ax.com:

I think that to open Outlook minimized one must not have the Open Outlook Today
option selected.

Outlook Today -> Customize Outlook Today

--
Lyle
--
Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

54
by: Brandon J. Van Every | last post by:
I'm realizing I didn't frame my question well. What's ***TOTALLY COMPELLING*** about Ruby over Python? What makes you jump up in your chair and scream "Wow! Ruby has *that*? That is SO...
4
by: Yann.K | last post by:
Hello. Using Tkinter, i would create a widget which display a shell command return. This return is long, and i would display a real time display (like with the tail -f commande on Linux) I...
8
by: Joe | last post by:
I'm using Python 2.4 on Windows XP SP2. I'm trying to receive a command line argument that is a newline (\n) Here is the command line to use sample.py "\n" Here is a sample.py script
0
by: Trips | last post by:
Hello Folks I have been having headache solving this and now I need your help I have developed an windows application which access network resources under differnt authenticated identity and...
2
by: bbxrider | last post by:
for win2k adv server/iis5.0 trying to run an external program from my asp routine that has multiple parameters, see following set shell = server.createobject("wscript.shell") shell.Run...
8
by: Siemel Naran | last post by:
Hi. I'm writing a command shell that reads commands from standard input. At this point I have the command in a std::string. Now I want to execute this command in the shell. From the Borland...
3
by: Mr Utkal Ranjan | last post by:
Hi Friends I want to launch notepad with a specific file on a command click event. So I was using the "Shell" function from VB on a command click event.For ex: Shell "Notepad.exe C:\Program...
2
by: micahstrasser | last post by:
I have been trying for days to send a command to the command prompt through the shell() function in vb.net. For some reason it is not working. Here is the code: Private Sub Button1_Click(ByVal...
7
by: Samuel A. Falvo II | last post by:
I have a shell script script.sh that launches a Java process in the background using the &-operator, like so: #!/bin/bash java ... arguments here ... & In my Python code, I want to invoke...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.