Showing Microsoft Outlook's Inbox

  • Thread starter Thread starter Mike Appell
  • Start date Start date
M

Mike Appell

Hello - I am trying to find a way to show Outlook's Inbox. I already know
how to use FindWindow to flip over to Outlook but it just flips over to
whatever window is present which could be the calendar, tasks, etc. I'm
wondering if there is a way to make it show the Inbox.

Thanks.
 
Please explain why you cannot find the Outlook inbox? Using the folder
view, click on the inbox. Or in the all mail folders view, do the same. If
this does not answer your question, then post your version. Would have
saved me some time and perhaps given me a few more minutes of much needed
sleep.

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. Due to
the (insert latest virus name here) virus, all mail sent to my personal
account will be deleted without reading.

After furious head scratching, Mike Appell asked:

| Hello - I am trying to find a way to show Outlook's Inbox. I already
| know how to use FindWindow to flip over to Outlook but it just flips
| over to whatever window is present which could be the calendar,
| tasks, etc. I'm wondering if there is a way to make it show the
| Inbox.
|
| Thanks.
 
"Milly Staples [MVP - Outlook]"
Please explain why you cannot find the Outlook inbox? Using the folder
view, click on the inbox. Or in the all mail folders view, do the same.
If
this does not answer your question, then post your version. Would have
saved me some time and perhaps given me a few more minutes of much needed
sleep.

Mike's trying to do it programmatically from Visual FoxPro, not
interactively.
 
Milly, get some sleep.

The question mentions the FindWindow API call, which isn't something you use
with a mouse. He's clearly asking how to do this in code.

Dan
Please explain why you cannot find the Outlook inbox? Using the
folder view, click on the inbox. Or in the all mail folders view, do
the same. If this does not answer your question, then post your
version. Would have saved me some time and perhaps given me a few
more minutes of much needed sleep.

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. Due to
the (insert latest virus name here) virus, all mail sent to my
personal account will be deleted without reading.

After furious head scratching, Mike Appell asked:
Hello - I am trying to find a way to show Outlook's Inbox. I already
know how to use FindWindow to flip over to Outlook but it just flips
over to whatever window is present which could be the calendar,
tasks, etc. I'm wondering if there is a way to make it show the
Inbox.

Thanks.
 
Exactly - I'm trying to find a way to do it programmatically. I already
know how to use FindWindow to flip over to Outlook but it just flips over to
whatever window is present which could be the calendar, tasks, etc. I'm
wondering if there is a way to make it show the Inbox.

Thanks,
Mike



Andrew Howell said:
"Milly Staples [MVP - Outlook]"
Please explain why you cannot find the Outlook inbox? Using the folder
view, click on the inbox. Or in the all mail folders view, do the same.
If
this does not answer your question, then post your version. Would have
saved me some time and perhaps given me a few more minutes of much needed
sleep.

Mike's trying to do it programmatically from Visual FoxPro, not
interactively.
 
Here's one idea I thought of but I will need some additional help. I
noticed that if I use FindWindow and search the caption rather than the
class then if it is already at the Inbox it's just a matter of flipping
over. Otherwise, I could just launch outlook a second time because it just
uses the same profile they signed on as the first time. This may actually
be a better solution for me anyways.

Does anyone know the best way to launch outlook programmatically? It's
possible that users may be running different versions depending on their
workstation so I'm looking for the best way to do this.

Thanks,
Mike


Dan Freeman said:
Milly, get some sleep.

The question mentions the FindWindow API call, which isn't something you
use
with a mouse. He's clearly asking how to do this in code.

Dan
Please explain why you cannot find the Outlook inbox? Using the
folder view, click on the inbox. Or in the all mail folders view, do
the same. If this does not answer your question, then post your
version. Would have saved me some time and perhaps given me a few
more minutes of much needed sleep.

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. Due to
the (insert latest virus name here) virus, all mail sent to my
personal account will be deleted without reading.

After furious head scratching, Mike Appell asked:
Hello - I am trying to find a way to show Outlook's Inbox. I already
know how to use FindWindow to flip over to Outlook but it just flips
over to whatever window is present which could be the calendar,
tasks, etc. I'm wondering if there is a way to make it show the
Inbox.

Thanks.
 
Mike said:
Does anyone know the best way to launch outlook programmatically? It's
possible that users may be running different versions depending on their
workstation so I'm looking for the best way to do this.


Hi Mike,

See this:


<vfp code>

**********************************************************
** A sample form with Outlook components.
**********************************************************
** Author : Ramani (Subramanian.G)
** FoxAcc Software / Winners Software
** (e-mail address removed)
** Type : Freeware with reservation to Copyrights
** Warranty : Nothing implied or explicit
**********************************************************
** How to Run..
** 1. Save the following code as oLook.PRG
** 2. From within PRG or Command Window call it with code
** DO oLook
** 3. You need : Outlook 2000 installed in your system.
**********************************************************
** oLook.prg
Public oform1
oform1=createobject("form1")
oform1.Show
Return
**********************************************************
Define Class form1 As Form

Height = 400
Width = 620
DoCreate = .T.
Caption = "Form1"
Name = "Form1"

Add Object cmdExit As CommandButton With ;
Top = 330, ;
Left = 504, ;
Height = 27, ;
Width = 84, ;
Caption = "E\<xit", ;
Name = "CmdExit"

Add Object cmdCalendar As CommandButton With ;
Top = 330, ;
Left = 12, ;
Height = 27, ;
Width = 84, ;
Caption = "\<Calendar", ;
Name = "CmdCalendar"

Add Object cmdInBox As CommandButton With ;
Top = 330, ;
Left = 108, ;
Height = 27, ;
Width = 84, ;
Caption = "\<In Box", ;
Name = "CmdInBox"

Add Object cmdSent As CommandButton With ;
Top = 330, ;
Left = 204, ;
Height = 27, ;
Width = 84, ;
Caption = "\<Sent Mail", ;
Name = "CmdSent"

Add Object cmdContact As CommandButton With ;
Top = 330, ;
Left = 300, ;
Height = 27, ;
Width = 84, ;
Caption = "\<AddressBook", ;
Name = "CmdContact"

Add Object cmdNewMail As CommandButton With ;
Top = 360, ;
Left =12 , ;
Height = 27, ;
Width = 84, ;
Caption = "New \<Mail", ;
Name = "cmdNewMail"

Add Object cmdNewTask As CommandButton With ;
Top = 360, ;
Left =108 , ;
Height = 27, ;
Width = 84, ;
Caption = "New \<Task", ;
Name = "cmdNewTask"

Add Object cmdNewContact As CommandButton With ;
Top = 360, ;
Left =204 , ;
Height = 27, ;
Width = 84, ;
Caption = "\<New Contact", ;
Name = "cmdNewContact"

Add Object cmdNewAppointment As CommandButton With ;
Top = 360, ;
Left =300 , ;
Height = 27, ;
Width = 110, ;
Caption = "New A\<ppointment", ;
Name = "cmdNewAppointment"

Add Object olecontrol1 As OleControl With ;
Top = 12, ;
Left = 12, ;
Height = 306, ;
Width = 588, ;
Name = "Olecontrol1", ;
OleClass = "OVCtl.OVCtl.1"

Procedure cmdExit.Click
Thisform.Release()
Endproc

Procedure cmdNewMail.Click
Thisform.olecontrol1.NewMessage()
ENDPROC

Procedure cmdNewTask.Click
Thisform.olecontrol1.NewTask()
Endproc

Procedure cmdNewContact.Click
Thisform.olecontrol1.NewContact()
ENDPROC

Procedure cmdNewAppointment.Click
Thisform.olecontrol1.NewAppointment()
Endproc

Procedure cmdCalendar.Click
Thisform.olecontrol1.Folder = "CALENDAR"
Thisform.Caption = "OutLook Calendar"
Thisform.Refresh()
Endproc

Procedure cmdInBox.Click
Thisform.olecontrol1.Folder = "INBOX"
Thisform.Caption = "OutLook InBox"
Thisform.Refresh()
Endproc

Procedure cmdSent.Click
Thisform.olecontrol1.Folder = "SENT ITEMS"
Thisform.Caption = "OutLook Sent Items"
Thisform.Refresh()
Endproc

Procedure cmdContact.Click
Thisform.olecontrol1.Folder = "CONTACTS"
Thisform.Caption = "OutLook Address Book"
Thisform.Refresh()
Endproc

Procedure olecontrol1.Init
This.Folder = "InBox"
Endproc

Enddefine
*********************************************************
** EOF
*********************************************************

</vfp code>


HTH


Saludos,
Jaime Vasquez
Guatemala C.A.
 
Your method appears to be running in a VFP form. I would like to just
launch it with ShellExecute or something like that. Does anyone know the
correct syntax for this?

Thanks,
Mike
 
o = CREATEOBJECT('outlook.application')
ns = o.GetNamespace('mapi')
df = ns.GetDefaultFolder(6)
df.Display
 
Thanks Mike - I think that will do the trick. I notice that when I release
the variables and even quit VFP, the Outlook window still stays open which
is good.

Mike
 
Well, gee, pardon me for not being a programmer!

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. Due to
the (insert latest virus name here) virus, all mail sent to my personal
account will be deleted without reading.

After furious head scratching, Dan Freeman asked:

| Milly, get some sleep.
|
| The question mentions the FindWindow API call, which isn't something
| you use with a mouse. He's clearly asking how to do this in code.
|
| Dan
|
| Milly Staples [MVP - Outlook] wrote:
|| Please explain why you cannot find the Outlook inbox? Using the
|| folder view, click on the inbox. Or in the all mail folders view, do
|| the same. If this does not answer your question, then post your
|| version. Would have saved me some time and perhaps given me a few
|| more minutes of much needed sleep.
||
|| --
|| Milly Staples [MVP - Outlook]
||
|| Post all replies to the group to keep the discussion intact. Due to
|| the (insert latest virus name here) virus, all mail sent to my
|| personal account will be deleted without reading.
||
|| After furious head scratching, Mike Appell asked:
||
||| Hello - I am trying to find a way to show Outlook's Inbox. I
||| already know how to use FindWindow to flip over to Outlook but it
||| just flips over to whatever window is present which could be the
||| calendar, tasks, etc. I'm wondering if there is a way to make it
||| show the Inbox.
|||
||| Thanks.
 
You can only have 1 instance of Outlook running at a time. What you can do
is check to see if the folder you want is there in the Explorer window
caption and if not add a new Explorer to the Explorers collection and make
the new Explorer's CurrentFolder object the Inbox.

In Explorer's you don't get the final window caption until the first
Explorer.Activate event fires. Until then it's a generic caption, usually
"Microsoft Outlook". After the first Explorer.Activate event fires it would
say something like "Inbox - Microsoft Outlook".
 
If all you want is to show Outlook's Inbox from anywhere, you can just
execute the command line: "outlook://Inbox".
 
Back
Top