Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sample OutLook in VFP Form 10

Status
Not open for further replies.

ramani

Programmer
Mar 15, 2001
4,336
AE
The question of outLook folders often come in this forum. SO just thought of adding my small contribution here. This may not be the only way to do it.. nor this is an end..

Copy the code below as a Olook.PRG and run it. If you use Outlook 2000, this will work. I prepared this in just as little a time as it will take to type in the code, the real thinking will be put a little later and I will add that as a FAQ.
*********************************************************
** Author : Ramani (Subramanian.G)
** FoxAcc Software / Winners Software
** ramani_g@yahoo.com
** Type : Freeware with reservation to Copyrights
** Warranty : Nothing implied or explicit
** Created : 17 January, 2003
*********************************************************
** How to Run..
** 1. Save the following code as oLook.PRG
** 2. From within the command window ...
** DO oLook
*********************************************************

** PROCEDURE OLOOK.PRG
PUBLIC oform1
oform1=NEWOBJECT("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 = 360, ;
Left = 504, ;
Height = 27, ;
Width = 84, ;
Caption = &quot;E\<xit&quot;, ;
Name = &quot;CmdExit&quot;

ADD OBJECT cmdCalendar AS commandbutton WITH ;
Top = 360, ;
Left = 12, ;
Height = 27, ;
Width = 84, ;
Caption = &quot;\<Calendar&quot;, ;
Name = &quot;CmdCalendar&quot;

ADD OBJECT cmdInBox AS commandbutton WITH ;
Top = 360, ;
Left = 108, ;
Height = 27, ;
Width = 84, ;
Caption = &quot;\<In Box&quot;, ;
Name = &quot;CmdInBox&quot;

ADD OBJECT cmdSent AS commandbutton WITH ;
Top = 360, ;
Left = 204, ;
Height = 27, ;
Width = 84, ;
Caption = &quot;\<Sent Mail&quot;, ;
Name = &quot;CmdSent&quot;

ADD OBJECT cmdContact AS commandbutton WITH ;
Top = 360, ;
Left = 300, ;
Height = 27, ;
Width = 84, ;
Caption = &quot;\<AddressBook&quot;, ;
Name = &quot;CmdContact&quot;

ADD OBJECT olecontrol1 AS olecontrol WITH ;
Top = 12, ;
Left = 12, ;
Height = 336, ;
Width = 588, ;
Name = &quot;Olecontrol1&quot;, ;
OleClass = &quot;OVCtl.OVCtl.1&quot;

PROCEDURE cmdExit.Click
ThisForm.Release()
ENDPROC

PROCEDURE cmdCalendar.Click
ThisForm.OleControl1.Folder = &quot;CALENDAR&quot;
ThisForm.Caption = &quot;OutLook Calendar&quot;
ThisForm.Refresh()
ENDPROC

PROCEDURE cmdInBox.Click
ThisForm.OleControl1.Folder = &quot;INBOX&quot;
ThisForm.Caption = &quot;OutLook InBox&quot;
ThisForm.Refresh()
ENDPROC

PROCEDURE cmdSent.Click
ThisForm.OleControl1.Folder = &quot;SENT ITEMS&quot;
ThisForm.Caption = &quot;OutLook Sent Items&quot;
ThisForm.Refresh()
ENDPROC

PROCEDURE cmdContact.Click
ThisForm.OleControl1.Folder = &quot;CONTACTS&quot;
ThisForm.Caption = &quot;OutLook Address Book&quot;
ThisForm.Refresh()
ENDPROC

PROCEDURE olecontrol1.Init
This.Folder = &quot;InBox&quot;
ENDPROC

ENDDEFINE
* EndDefine: form1

*********************************************************
* EOF
*********************************************************
:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
May be it will be usefull for me in future, but tell me: is this program worked at VFP6 ? Kind regards from Warsaw !!!!!
Monika (monikai@yahoo.com)
 
monikai

May be it will be usefull for me in future, but tell me: is this program worked at VFP6 ?

Yes it does work in VFP6.0 and if you change the:
oform1=NEWOBJECT(&quot;form1&quot;)
to
oform1=CREATEOBJECT(&quot;form1&quot;)

It will work in VFP5.0.
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi Mike,

Thanks for pointing that. I would change it that way for future. And that has answere Monikai also.:)


ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Hi Ramani,
would you like add &quot;newmail&quot;,&quot;outbox&quot;,&quot;sent items&quot; buttons to this code ?

TIA Soykan OZCELIK
Comp.Prog / MSFoxPro Programmer Developer
 
kosta

would you like add &quot;newmail&quot;,&quot;outbox&quot;,&quot;sent items&quot; buttons to this code ?

I think Ramani's code is simple enough that you would easily be able to add it yourself.
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi Mike,

Your answer is spot on... but it begs the question... why doesn't the Error message say
&quot;Microsoft Outlook View Control&quot; activex is not present on your system... Instead of &quot;ole error code 0x800401f3: invalid class string&quot;.

Actually I don't want an answer for this ... please just register it as a complaint... With all this technology cant MS do better than 0x800401f3

In my case I actually have Outlook 2000 on the system
I actually still get the error 0x800401f3 ... and in the
Tools->Options etc etc I cannot seem to find MS Outlook in the Active X list....so I cannot add it.




JF
 
John

Actually, it may be only available in Outlook 2002 (XP), it was just an assumption on my part, sisnce both versions are very similar. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I get the same error on 2 separate machines...!!! Could there be something wrong with the class definitions ?
 
John

Do you have the &quot;Microsoft Outlook View Control&quot; activex listed in your controls?
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I cant find
&quot;Microsoft Outlook View Control&quot; activex listed in my controls...

&quot;Microsoft Excel&quot; is there,
the
&quot;Microsoft Word&quot; is there, and there are some Outlook controls (but without the prefix Microsoft) ...

Namely

Outlook DocSite OLE
Outlook Express MIME
Outlook Header OLE
Outlook Recipient collection


This is crazy... because Outlook IS installed.. I can CREATEOBJECT(&quot;outlook.application&quot;) which works...
..

JF


 
John

Do you have Office XP installed or 2000? I believe it came with XP. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike,

I have Win XP OS with Office 2000 on one machine... and Win2000 with Office 2000 on the other...


ADD OBJECT olecontrol1 AS olecontrol WITH ;
Top = 12, ;
Left = 12, ;
Height = 336, ;
Width = 588, ;
Name = &quot;Olecontrol1&quot;, ;
OleClass = &quot;OVCtl.OVCtl.1&quot;


It is this line of code that has me foxed !!! I cant find any help to explain this line of code so that I can work this out. This seems to be the line that causes the thing to stop working...

Is there any help references.....

Ramani, am I the only one that cannot get a simple copy of your code to work ???

John Fox
 
Hi

I was so busy and Mike was answering, I did not respond to many.

The OLE control is
Microsift OutLook View control. I have tested this on XP with Office XP. The related DLL file is..
OUTLCTL.DLL
and this will be fond in the MicrosoftOffice\Office10 directory.

HOwever, and similar earlier Outlook 2000 control can also be used. But I am unable to testify that with my preoccupations. Will do that on a later date, if by that time no one confirmed that. Or specify an alternative. :)

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
The outlctl.dll (dated 11/23/1998) I had with W2K & Outlook 2000 would not register.
I was able to download a newer version (dated 7/26/2001) from :



This works.

My $0.02

Ed Please let me know if the suggestion(s) I provide are helpful to you.
Sometimes you're the windshield... Sometimes you're the bug.
smallbug.gif
 
Thanks Ramani and 0.02 Ed


related DLL file is..
OUTLCTL.DLL
and this will be fond in the MicrosoftOffice\Office10 directory.


On XP machine --- Found that (in my case it is in the MicrosoftOffice\Office directory) date 11/24/1998 (whoa)


it wouldn't register on my Win XP Pro machine!!!...

I also downloaded Ed's recommendation
used the
Tools -> Options -> AxtiveX -> Add Libraries pointed at Ed's updated version.... and tested it...

WORKS ABSOLUTELY BEAUTIFULLY

Now it is registered does it matter into which directory it goes ? (I put it in its own DLL subdirectory)

Thanks to all .... sorry I was so slow...

Ed you are worth at least a nickel (0.05)!!!

Thanks Ramani what a great little suggestion

Ramani, maybe when you convert the post into a FAQ, you might consider suggesting a one liner that checks that date of the OUTLCTL.DLL file


(Pity that darn Tek-Tips search engine is still down !)

 
Whoops.. better english

Ramani, maybe when you convert the post into a FAQ, you might consider adding a one line suggestion to the user
that suggests that they check that date of the OUTLCTL.DLL file.. and update (download) and register as necessary..

John Fox
 
John

Now it is registered does it matter into which directory it goes ? (I put it in its own DLL subdirectory)

If DLL are registered, it doesn't matter where its registered. VFP looks in the registry, which in turn points to the actual location of the DLL.
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
What if I want to show something under public folder?

Something Like:
-Public Folder
-All Public Folder
-XXX
-My Calendar

Where I want to show 'My Calendar'
 
Ramani... Like I said earlier, your code works like a charm on my XP Pro Outlook 2000 setup. I tried it on my W2000 Outlook 2000 machine and I get an error...

OLE Error code 0x80070005. Access is denied.

on the line
This.Folder = &quot;InBox&quot;

in your procedure

PROCEDURE olecontrol1.Init
This.Folder = &quot;InBox&quot;
ENDPROC


Is this some security issue with Outlook (I cannot seem to find a setting)...

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top