473,691 Members | 2,446 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 10070
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
6549
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
9921
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
3448
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
1568
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
7486
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
11825
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
6668
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
6232
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
8599
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9079
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8951
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...
0
7623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6457
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
5813
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
4322
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
4550
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
1952
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.