Make a window active

Hey all

I'm trying to write a script that will make Outlook the active window,
whether its minimized or not. It will then send Alt+F4 to close it. I
have no idea how to make Outlook the active window. Any ideas?
0
Matt
1/26/2010 4:41:35 PM
scripting.vbscript 564 articles. 0 followers. Follow

2 Replies
1862 Views

Similar Articles

[PageSpeed] 0

On Jan 26, 11:41=A0am, Matt Longo <justice8...@gmail.com> wrote:
> Hey all
>
> I'm trying to write a script that will make Outlook the active window,
> whether its minimized or not. It will then send Alt+F4 to close it. I
> have no idea how to make Outlook the active window. Any ideas?

I wouldn't do it that way.  I'd access the provided DCOM interface,
thus ...

sStatus =3D "Not Found"
on error resume next
  set oOutlook =3D getobject("", "Outlook.Application")
  if err.number =3D 0 then oOutlook.quit : sStatus =3D "Found"
On error goto 0
wsh.echo sStatus
_____________________
Tom Lavedas
0
Tom
1/26/2010 5:48:08 PM
On Jan 26, 12:48=A0pm, Tom Lavedas <tglba...@verizon.net> wrote:
> On Jan 26, 11:41=A0am, Matt Longo <justice8...@gmail.com> wrote:
>
> > Hey all
>
> > I'm trying to write a script that will make Outlook the active window,
> > whether its minimized or not. It will then send Alt+F4 to close it. I
> > have no idea how to make Outlook the active window. Any ideas?
>
> I wouldn't do it that way. =A0I'd access the provided DCOM interface,
> thus ...
>
> sStatus =3D "Not Found"
> on error resume next
> =A0 set oOutlook =3D getobject("", "Outlook.Application")
> =A0 if err.number =3D 0 then oOutlook.quit : sStatus =3D "Found"
> On error goto 0
> wsh.echo sStatus
> _____________________
> Tom Lavedas


That worked great. Thanks a ton
0
Matt
1/26/2010 5:57:09 PM
Reply:

Similar Artilces:

outlook 2000 running under windows xp
Having recently received automatic updates for windows xp, outlook 2000 hangs on sending/receiving emails, is this a known problem ? I'm not aware of problems. Do you get any error messages? I'd try deleting the *.srs file. It's located at %USERPROFILE%\Local Settings\Application Data\Microsoft\Outlook -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlooktips.net EMO - a weekly newsletter about Outlo...

Microsoft Access macro from Windows service
I'm trying to launch a process from a Windows service that runs a MicrosoftAccess macro. I'm having some trouble and wondering if anyone knows whetherthis is technically possible (since a service does not have a UI).Thanks in advance.Joe You can pass the name of the macro you want to run as an argument if you open Access from a .bat file. For example"C:\Program Files\Microsoft Office\Office11\MSAccess.exe" "C:\Program Files\Microsoft Office\Office11\Samples\Northwind.mdb" /yourmacronameDo yourself a favor and don't use spaces or special characters in your macr...

Make Default
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Email Client: Exchange Hi I have a script to open entourage to configure a account, although the first time round for every user the script stops due to the message in Entourage asking would you like to make entourage you default browser. <br> Anyone have a script to set this to default or any way of setting this so it never ask's ? <br><br>thanks This is a multi-part message in MIME format. ----------------709806166701805979 Content-Type: text/plain; charset=iso-8859-1; format=flowed C...

Making a Pivot chart from 3 differnt sets of data / worksheets.
Hi, I have 2 workshsheets of data with a list of delivery dates of about 10 different products over the last 3 years, (i cant combine these to just 1 worksheet for other separate reasons) and a 3rd worksheet with a column of the same products and dates that some of these products became faulty and were sent back to me . On a 4th worksheet, I am trying to do a graph that looks at the 3 worksheets and plots pivot table of dates and amount of each product deliveries & returned to me. So as i select ,say, product A from that pivot list, it produces a graph for these 3 variables (dat...

making a transfer show up in the budget
Hi all. I am running MS money 2006. How do I make a transfer show up in my budget? I have several liabilities and credit cards, and I would like to make a budget with the monthly amount owed to each creditor showing up in my budget. The MS Money 2006 standard program does not allow me, as far as I can tell, to make a monthly transfer to a credit card or liability show up in my budget, unless I make it a category. Any help with this is much appreciated. thanks See http://umpmfaq.info/faqdb.php?q=124 for the short answer. You may be more interested in "cash flow" than &qu...

Windows Installer Cleanup Issue
In trying to install Java 6 u18 I started getting the message THIS ACTION ONLY VALID FOR PRODUCTS CURRENTLY INSTALLED At that point Java, which had always worked, stopped working. After reading this forum I downloaded the Windows Install Cleanup and removed the Java 6 u18 from the list of installed products. Java does not appear in the Control Panel under Programs, the registry has no Java 6.18 remnants I can see and Java does not appear in the Windows Install Cleanup list. Yet when I re-download Java, as soon as the install starts it says, THE SOFTWARE HAS ALREADY BEEN...

making tickets
what is the best way to make numbered tickets using Publisher 2002? Hi lc (rconnell@numail.org), in the Microsoft Office Publisher newsgroup you posted: || what is the best way to make numbered tickets using || Publisher 2002? Check out the following link: http://www.mvps.org/publisher/numbering1.html -- Brian Kvalheim Microsoft Office Publisher MVP Official Publisher MVP Site: http://www.kvalheim.org This posting is provided "AS IS" with no warranties, and confers no rights. >-----Original Message----- >what is the best way to make numbered tickets using >Publi...

windows version of xcopy
Hi, Sorry to post this question here (since it's my most often used news group). Do you guys know any Windows tool that copies files/directories using a customizable filter? That is, it allows us to specifies what types of files to be included (or excluded) during copying? Or you know any news groups to post this question? Thanks for any help. Tony SHFileOperation. joe On Sun, 12 Nov 2006 20:40:14 -0800, JD <jdt_young@yahoo.com> wrote: >Hi, > >Sorry to post this question here (since it's my most often used news >group). Do you guys know any Windows t...

How make a favorite for all users in Ex2007/OWA/Documents area?
I am playing around with OWA in 2007 and exploring the "documents" feature of OWA that allows users to view Windows file shares by UNC. There is the individual "add to favories" option, but does anyone know of a way to administratively specify a favorite for all users? The alternative seems to be logon as each user to setup the same favorite--surely that is not the only way? Thanks for any help! Evan ...

AN OPPORTUNITY TO MAKE $$$
THIS REALLY WORKS IF YOU FOLLOW THROUGH!!! MAKE MONEY!!! MAKE MONEY!!! MAKE THOUSANDS OF "$$$" !!! I found this "NETWORKING PROJECT" on a bulletin board and decided to try it: All I say is, it "WORKS". All it takes is a small INVESTMENT of your "TIME" AND "less than $10.00"! INTERESTED??? E-mail: "spotty3443@yahoo.com" for DETAILS. ...

Microsoft Dynamics CRM 3.0 Mobile Supports Windows Mobile 5.0
http://www.geekzone.co.nz/content.asp?contentid=5641 ========================= John O'Donnell Microsoft CRM MVP http://www.microsoft.com/businesssolutions/crm/community/microsoft_crm_community.mspx Can u give waht are the models Microsoft Dynamics CRM 3.0 Mobile Supports? John O'Donnell wrote: > http://www.geekzone.co.nz/content.asp?contentid=5641 > > ========================= > John O'Donnell > Microsoft CRM MVP > http://www.microsoft.com/businesssolutions/crm/community/microsoft_crm_community.mspx ...

how do you make all incoming emails bold?
"Beth" <Beth@discussions.microsoft.com> wrote in message news:CD76AE42-9EC9-44C8-90FB-3A0566671AC4@microsoft.com... > I could've sworn there was a message here, but when I looked the body was completely blank. Oh well, guess the poster really didn't want to ask a question. how do you make all incoming emails bold? "Vanguard (NPI)" wrote: > "Beth" <Beth@discussions.microsoft.com> wrote in message > news:CD76AE42-9EC9-44C8-90FB-3A0566671AC4@microsoft.com... > > > > > I could've sworn there was a messag...

How do I make the X-Axis increase in scale with the quantity?
For example: If I have the values 1.5, 3.5, 8.7, 9.9 in the x values for a line graph, is there anyway to make them spaced apart so that they are in scale with eachother... Like so the distance between 3.5 and 8.7 is larger than, the distance between 1.5 and 3.5? Create a XY Scatter chart. It, and a bubble chart, are the only 2 that allow for cardinals values on the x axis. -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article <F2D3DC58-86D3-4D21-9D57-F704A78941FB@microsoft.com>, =?Utf- 8...

The |= for windows styles ?
Hi guys, This isn't really MFC but it's the only time I see it so I'm asking here. What does the |= do ? I think it adds a flag if it isn't already there but I don't know for sure. Like this: DWORD dwStyle=WS_CHILD; dwStyle |= WS_VISIBLE; // does dwStyle become the same as WS_CHILD | WS_VISIBLE ? Also, what about this: DWORD dwStyle=WS_CHILD; dwStyle &= WS_VISIBLE; // does that mean it will add WS_VISIBLE no matter what ? So it could mess it up if it's already there right ? Thanks. This is a multi-part message in MIME format. ------=_NextPart_000_000A_01C4...

How to make VLOOKUP work for this
I have a "master" spreadsheet where column A is a time column and every row represents a second (in plain text format) such as 00:00, 00:01, 00:02.... 00:59:, 01:00, 01:01, 01:02,... and continues on for 24 minutes... 23:59, 24:00. (1442 rows). Off to the side (I'm thinking of putting it on another sheet though) I have a small table where I'll enter the time and corresponding data I need populated in Column B, and will look something like the following example; My question(s) are, is the VLOOKUP function the best way to populate column B with the values? It's ...

Multiple IE Windows Opening
I know this is an old issue and I have looked for an answer but seem to get conflicting results. I have Vista Business x64 and IE8. Randomly, upon closing IE, a flury of IE windows will open. I have used Malwarebytes and Spybot. I have very few add-ons. Any suggestions about where else to look? I am assuming the cause is some malware or other nasty. Thank you for your help. What anti-virus application or security suite is installed and is your subscription current? What anti-spyware applications (other than Defender)? What third-party firewall (if any)? Were any of these a...

How do I make more than 12 entries in excel balance sheet templat.
The excel balance sheet template is exactly what I need. How do I get it to expand to an infinite number of entries?? office xp ...

Make Personal Calendar Read Only
I would like to make a users personal calendar read-only to the user. The individuals calendar is delegated to about 5 others and they need full access, but I do not want the end-user to have full access but read only. How do I go about changing these permissions? Thanks, Brian I don't believe that is even possible through the standard means, it is a little bizarre. You may be able to do it through a tool like ADSIEdit. Nue "HoosierDaddy" <bjorgenson@charter.net> wrote in message news:1139250053.396235.106790@o13g2000cwo.googlegroups.com... >I would like to make a...

How to define custom window proc in MFC?
In Win32, you can register a window class with custom defined window proc. But in MFC, it said that lpfnWndProc in WNDCLASS must be AfxWndProc. How is it possible to use custom window proc in MFC then? Thanks. Michael In MFC you subclass a window. MFC does it for you by replacing the window procedure with AfxWndProc. If you dont like what AfxWndProc is doing, you use message maps to achieve that. That should be sufficient for most cases. For example, if you want to handle WM_SIZE, you will use message map (OnSize) and not care about substituting a window procedure for the window. There ar...

Is it Possible to make a table from a query without a Make Table Q
Is it possible to make a table with a query as the record source, without using a Make Table Query. The reason that I as is that I have a rather large database that I use to create tables for each day of the month based on activity recieved from a larger database. I use one Pass-Through query as the source for 31 Make Table queries. The reason I have done this is because I need to segregate the activity by date so that I can produce daily averages over the entire month. The reason that I have had to break each one per day is the Pass Through query is huge (returning 7,000,000 + rec...

Making a bmp transparent
Using Publisher 2000 Windows 98SE Is it possible to make a graphic file transparent? I'm attempting to create a motivational cartoon and would like to have a couple of scenes in the background. To do this I think I need to make an image file transparent. Can it be done? I have Paint Shop Pro and MS Paint. I have the challenge in the file, "Problem.zip" which can be downloaded at: http://www.tinyurl.com/wifs On the "Odds, Ends & Funny Things page. Click on the Snowman. 'Appreciate the help. -- Don -------- Vancouver, USA - One of the great cities in one of...

Windows Hooks #2
Hello. I'm not sure in which group I should post it, so I try to post it here. I use Windows hooks to hook up keyboard typing. I use a hook type WH_GETMESSAGE and catching WM_CHAR message. When use press the button for some reason I'm getting a message twice. The parameters are always the same, so I have no idea why it is. Could anybody help me with it? Or suggest me the right news group for such question... Thank you. -- ---- German Koninin --------------------------------------- For every complex problem, there's solution that is simple, neat and wrong... On Fri, 17 Dec ...

RE: Apply that important package for Windows
--yaqeyogaveklfru Content-Type: multipart/related; boundary="qitowqjkjro"; type="multipart/alternative" --qitowqjkjro Content-Type: multipart/alternative; boundary="wzgxlttfuoycyj" --wzgxlttfuoycyj Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft Customer this is the latest version of security update, the "October 2003, Cumulative Patch" update which fixes all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three newly discovered vulnerabilities. Install now to...

How to make Frames??
how to make frames in microsoft publisher??? You use the Tool called TEXT FRAME Pretty easy I would have thought - obviously a challenge for some. -- i try to find in tool section.. but there is no button called TEXT FRAME? can u tell me the steps! PLZ!! Thankx.. and one more question.. i would link some sites... but i want that link(site) to be pop up in new window.? how to do it??? i've been trying to find it.. but then it always pop up in same window.. and could u tell me the steps?? plz. Thanzk Trust me, there is most definitely a button called Text Frame. Look in the HEL...

Save As window appears
I have an enduser using Outlook 2003 on an Exchange 2003 Server. When the user opens Outlook the Save As window pops up requesting that they save whichever email is highlighted in the Inbox. To get rid of the Save As window you have to open the task manager and kill the Outlook.exe process. We do integrate Hummingbird DM5 into Outlook and sometimes the Save As window will try to save one of our network documents as a .pdr file. How do I stop this from happening? Thanks, Casey <velveeta72@gmail.com> wrote in message news:1184177412.460996.28000@w3g2000hsg.googlegroups.com... >I ha...