473,785 Members | 2,289 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.ex e", vbHide
Shell "outlook.ex e", vbNormalFocus
Shell "outlook.ex e", vbMinimizedFocu s
Shell "outlook.ex e", vbMaximizedFocu s
Shell "outlook.ex e", vbNormalNoFocus
Shell "outlook.ex e", vbMinimizedNoFo cus

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 10084
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 BringWindowToTo p 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.ex e", vbHide
Shell "outlook.ex e", vbNormalFocus
Shell "outlook.ex e", vbMinimizedFocu s
Shell "outlook.ex e", vbMaximizedFocu s
Shell "outlook.ex e", vbNormalNoFocus
Shell "outlook.ex e", vbMinimizedNoFo cus

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 -- BringWindowToTo p 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 BringWindowToTo p 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.ex e", vbHide
Shell "outlook.ex e", vbNormalFocus
Shell "outlook.ex e", vbMinimizedFocu s
Shell "outlook.ex e", vbMaximizedFocu s
Shell "outlook.ex e", vbNormalNoFocus
Shell "outlook.ex e", vbMinimizedNoFo cus

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 BringWindowToTo p Lib "user32" Alias
"BringWindowToT op" (ByVal hwnd As Long) As Long

Then call it using code like:
Shell "outlook.ex e", vbNormalNoFocus 'no focus does not work.
BringWindowToTo p Application.hWn dAccessApp '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 -- BringWindowToTo p 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 BringWindowToTo p 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.ex e", vbHide
Shell "outlook.ex e", vbNormalFocus
Shell "outlook.ex e", vbMinimizedFocu s
Shell "outlook.ex e", vbMaximizedFocu s
Shell "outlook.ex e", vbNormalNoFocus
Shell "outlook.ex e", vbMinimizedNoFo cus

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 BringWindowToTo p Lib "user32" Alias
"BringWindowTo Top" (ByVal hwnd As Long) As Long

Then call it using code like:
Shell "outlook.ex e", vbNormalNoFocus 'no focus does not work.
BringWindowToT op Application.hWn dAccessApp '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 -- BringWindowToTo p 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 BringWindowToTo p 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.ex e", vbHide
Shell "outlook.ex e", vbNormalFocus
Shell "outlook.ex e", vbMinimizedFocu s
Shell "outlook.ex e", vbMaximizedFocu s
Shell "outlook.ex e", vbNormalNoFocus
Shell "outlook.ex e", vbMinimizedNoFo cus

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
backgroun d 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
BringWindowToTo p is executed.

Try this:
Shell "outlook.ex e", vbNormalNoFocus
Me.TimerInterva l = 500

Private Sub Form_Timer()
Me.TimerInterva l=0 'stop timer
BringWindowToTo p Application.hWn dAccessApp
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 BringWindowToTo p Lib "user32" Alias
"BringWindowT oTop" (ByVal hwnd As Long) As Long

Then call it using code like:
Shell "outlook.ex e", vbNormalNoFocus 'no focus does not work.
BringWindowTo Top Application.hWn dAccessApp '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 -- BringWindowToTo p API?
Where is that?
On Sat, 19 Mar 2005 18:52:05 -0600, Lauren Wilson <pr*****@nospam .com>
wrote:

Apparentl y Outlook is trying to be too helpful, thinking it knows
best.
Perhaps you can use the BringWindowToTo p 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
>followin g:
>
>Shell "outlook.ex e", vbHide
>Shell "outlook.ex e", vbNormalFocus
>Shell "outlook.ex e", vbMinimizedFocu s
>Shell "outlook.ex e", vbMaximizedFocu s
>Shell "outlook.ex e", vbNormalNoFocus
>Shell "outlook.ex e", vbMinimizedNoFo cus
>
>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
>backgrou nd 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.c om:

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
6577
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 FRICKIN' COOL!!! ***MAN*** that would save me a buttload of work and make my life sooooo much easier!" As opposed to minor differences of this feature here, that feature there. Variations on style are of no interest to me. I'm coming at this from a...
4
9943
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 think to use the text widget. I have no problem to execute the command, but how to display, in a *real-time* fashion the shell retrun?
8
3456
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
1578
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 not the client who is running the application The application runs on client machine and it has to access a network folder by impersonationg a specific user and downloads the file on client computer Now when user clicks on download/copy button...
2
7508
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 """f:\phsData\htmldoc\htmldoc.exe"" --webpage -f phsnew.pdf phsnew.htm" program either doesn't get invoked, or has an error, but since it has no error log i can't check that,
8
1333
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 newsgroups I learned that there is a function in stdlib.h called system. int system(const char *command); First question, is the system command ANSI compliant. Because I include <cstdlib> and write std::system(command.c_str()); it looks like an...
3
11832
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 Files\Test.txt",VbNormalFocus But here is the problem in the space of the "Program
2
6673
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 sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim command As String command = "systeminfo > C:\temp\sysinfo.txt"
7
6237
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 this shell script using the Subprocess module. Here is my code: def resultFromRunning_(command):
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10101
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7509
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.