dbTalk Databases Forums  

Ole Paradox and Outlook Calendar continued

comp.databases.paradox comp.databases.paradox


Discuss Ole Paradox and Outlook Calendar continued in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
OzPaul
 
Posts: n/a

Default Ole Paradox and Outlook Calendar continued - 08-01-2006 , 09:01 AM






A while ago I posted this topic which has since been closed without
resolution. Unfortunately for readers, I am like a dog with a bone on
this one and I am determined to discover if it is possible to use
Paradox OleAuto to find modify and delete an existing appointment in an
Outlook Calendar. In my limited understanding of transcribing VBscript
examples to Opal I have made very limited progress as described below.
I have been able to open a calendar and even open an appointment but
not locate one using specified criteria other than a limited number of
numerical indices... in the example below, the number one.. Finally,
any attempt to use code such as OleAuto = find.Item(Criteria) fails
with a message saying FIND method unknown to OLE server.... Personally
I find it difficult to believe someone hasn't done this sort of thing
with Opal in the past........ and if you have, please help me! Thanks
Paul

var
ol oleAuto
namespace oleAuto
Appt oleAuto
Fldr oleAuto
objInboxItems oleAuto
Item oleAuto
endvar

ol.Open("Outlook.Application") ; opens outlook application

namespace = ol.GetNamespace("MAPI") ; gets the MAPI namespace

Fldr = namespace.GetDefaultFolder(9) ;Gets Calendar
Fldr.display() ;Displays the Calendar True!

objInboxItems = Fldr.Items(1) ; seems to find an appointment
depending on the number value but I don't understand using what
criteria.
objInboxItems.Display() ; displays the found appointment


Reply With Quote
  #2  
Old   
OzPaul
 
Posts: n/a

Default Re: Ole Paradox and Outlook Calendar continued - 08-02-2006 , 02:46 AM






Well after all that, I have managed to find (and delete) an appointment
in Outlook using OPal and OleAuto! I will post the code and an
explanation soon for those interested... although judging by the
feedback, not too many. Anyway, at least I'm pleased... Paul.


Reply With Quote
  #3  
Old   
Thies Grimm
 
Posts: n/a

Default Re: Ole Paradox and Outlook Calendar continued - 08-02-2006 , 04:57 AM



Hi Paul,

did yuo manage the find job?

I have some experience in importing outlook data, but always loop
through the whole data which is time consuming :-)

Thies

OzPaul schrieb:
Quote:
Well after all that, I have managed to find (and delete) an appointment
in Outlook using OPal and OleAuto! I will post the code and an
explanation soon for those interested... although judging by the
feedback, not too many. Anyway, at least I'm pleased... Paul.


Reply With Quote
  #4  
Old   
Jean Friedberg
 
Posts: n/a

Default Re: Ole Paradox and Outlook Calendar continued - 08-02-2006 , 09:00 AM



I'd be interested. Jean

"OzPaul" <pfweston (AT) yahoo (DOT) com> wrote

Quote:
Well after all that, I have managed to find (and delete) an appointment
in Outlook using OPal and OleAuto! I will post the code and an
explanation soon for those interested... although judging by the
feedback, not too many. Anyway, at least I'm pleased... Paul.




Reply With Quote
  #5  
Old   
OzPaul
 
Posts: n/a

Default Re: Ole Paradox and Outlook Calendar continued - 08-02-2006 , 10:52 PM



Let me first say that I am still unable to get Ole "find" or "search"
to work but I have been able to achieve what I wanted to do. That is,
to use Opal to save a new appointment, initially created in the
database, in Outlook for all to see. Then to delete the appointment
when required, also using Opal. The easy part was creating an
appointment. Finding and deleting the appointment was difficult for me,
particularly since I have no programming expertise outside Paradox and
the only examples I could find were in VB, C or eventually in Delphi.
The latter finally helped clarify what is required... Nothing
revolutionary but I have not seen it done in Paradox before...

var
ol, namespace, AppointmentsFolder ,objInboxItems, vAppItem, Items
oleAuto
s String
dte datetime
endVar

ol.Open("Outlook.Application")
NameSpace = ol.GetNamespace("MAPI")
AppointmentsFolder = NameSpace.GetDefaultFolder(9) ; 9 being the
calendar constant
objInboxItems = AppointmentsFolder.Items ; gets appointment items
L = objInboxItems.count() ;counts the number of future appointments
for i from 1 to L
vAppItem = objInboxItems.Item(i) ; scans through the
AppointmentItems from most recently added to oldest entry
s = vAppItem.Subject ; stores subject line from each appointment
if advMatch(s, "70651") then ; match specified value such as
Paradox table index value which was stored in subject line for easy
retrieval when searching for appointment now.
; alternatively dte = vAppItem.Start ; you could also search
using "datetime" for a specific record with this start value.
;if advMatch(dte, "09:00:00, 07/09/2006") then (or some other
Appointment item)
vAppItem^delete() endif ; then delete it if the match is found.
endfor

This only works for a single non-recurring appointment, which is fine
for my requirements. I will probably create a table to keep a record of
appointments which have been copied to Outlook to assist in management.


I would appreciate any further comments. Paul.


Reply With Quote
  #6  
Old   
Jean Friedberg
 
Posts: n/a

Default Re: Ole Paradox and Outlook Calendar continued - 08-03-2006 , 03:53 PM



Thanks, Paul. Jean

"OzPaul" <pfweston (AT) yahoo (DOT) com> wrote

Quote:
Let me first say that I am still unable to get Ole "find" or "search"
to work but I have been able to achieve what I wanted to do. That is,
to use Opal to save a new appointment, initially created in the
database, in Outlook for all to see. Then to delete the appointment
when required, also using Opal. The easy part was creating an
appointment. Finding and deleting the appointment was difficult for me,
particularly since I have no programming expertise outside Paradox and
the only examples I could find were in VB, C or eventually in Delphi.
The latter finally helped clarify what is required... Nothing
revolutionary but I have not seen it done in Paradox before...

var
ol, namespace, AppointmentsFolder ,objInboxItems, vAppItem, Items
oleAuto
s String
dte datetime
endVar

ol.Open("Outlook.Application")
NameSpace = ol.GetNamespace("MAPI")
AppointmentsFolder = NameSpace.GetDefaultFolder(9) ; 9 being the
calendar constant
objInboxItems = AppointmentsFolder.Items ; gets appointment items
L = objInboxItems.count() ;counts the number of future appointments
for i from 1 to L
vAppItem = objInboxItems.Item(i) ; scans through the
AppointmentItems from most recently added to oldest entry
s = vAppItem.Subject ; stores subject line from each appointment
if advMatch(s, "70651") then ; match specified value such as
Paradox table index value which was stored in subject line for easy
retrieval when searching for appointment now.
; alternatively dte = vAppItem.Start ; you could also search
using "datetime" for a specific record with this start value.
;if advMatch(dte, "09:00:00, 07/09/2006") then (or some other
Appointment item)
vAppItem^delete() endif ; then delete it if the match is found.
endfor

This only works for a single non-recurring appointment, which is fine
for my requirements. I will probably create a table to keep a record of
appointments which have been copied to Outlook to assist in management.


I would appreciate any further comments. Paul.




Reply With Quote
  #7  
Old   
OzPaul
 
Posts: n/a

Default Re: Ole Paradox and Outlook Calendar continued - 08-15-2006 , 07:15 AM



Thies ,

I finally found a FIND syntax that works. The example below searches
the Subject field of the Calendar Appointments.

ol.Open("Outlook.Application")
NameSpace = ol.GetNamespace("MAPI")
AppointmentsFolder = NameSpace.GetDefaultFolder(9) ; 9 being the
calendar constant
objInboxItems = AppointmentsFolder.Items ; gets appointment items
Appt = objInboxItems^Find("[Subject] = Test2") ; finds the value
Test2 in the subject field
Appt^display()

Regards Paul.







Grimm




wrote:

Quote:
Hi Paul,

did yuo manage the find job?

I have some experience in importing outlook data, but always loop
through the whole data which is time consuming :-)

Thies

OzPaul schrieb:
Well after all that, I have managed to find (and delete) an appointment
in Outlook using OPal and OleAuto! I will post the code and an
explanation soon for those interested... although judging by the
feedback, not too many. Anyway, at least I'm pleased... Paul.



Reply With Quote
  #8  
Old   
Thies Grimm
 
Posts: n/a

Default Re: Ole Paradox and Outlook Calendar continued - 08-15-2006 , 09:48 AM



Hi Paul,

thanks a lot. I will test it immediately.

Thies


OzPaul schrieb:
Quote:
Thies ,

I finally found a FIND syntax that works. The example below searches
the Subject field of the Calendar Appointments.

ol.Open("Outlook.Application")
NameSpace = ol.GetNamespace("MAPI")
AppointmentsFolder = NameSpace.GetDefaultFolder(9) ; 9 being the
calendar constant
objInboxItems = AppointmentsFolder.Items ; gets appointment items
Appt = objInboxItems^Find("[Subject] = Test2") ; finds the value
Test2 in the subject field
Appt^display()

Regards Paul.

Reply With Quote
  #9  
Old   
OzPaul
 
Posts: n/a

Default Re: Ole Paradox and Outlook Calendar continued plus Contacts - 08-16-2006 , 07:49 PM



As a post-script, I have been asked if I know how to use oleAuto to
access a custom folder created under Contacts in Outlook. The problem
is that while Contacts has a numerical constant of 10, the customised
folder doesn't have a numerical constant associated with it because
it is not one of the Outlook default folders. After some research, I
worked out the following code which I am showing for anyone who is
interested. Thanks to Andy McClure for the question. I feel like I am
starting to understand this stuff a little better. Regards Paul.

Andy, This works for me. Refer also to
http://www.utmag.com/wconnect/wc.dll...me~9,7,10,1602
for some useful guidelines.

var
ol oleAuto
namespace oleAuto
objNS oleAuto
Appt oleAuto
Fldr oleAuto
objInboxItems oleAuto
ContactsFolder oleAuto
Items oleAuto
vAppItem oleAuto
endvar

ol.Open("Outlook.Application")
NameSpace = ol.GetNamespace("MAPI")
ContactsFolder = NameSpace.GetDefaultFolder(10) ; 10
being the contacts constant
objInboxItems = ContactsFolder.Folders ; gets all
the Contacts subfolders

L = objInboxItems.count() ;counts the number of
contacts subfolders
for i from 1 to L
vAppItem = objInboxItems.Item(i) ; scans through
the ContactsFolders
if vAppItem.Name = "Accounts" then ; if the
contacts folder name = Accounts.
vAppItem^display() ; display the folder
endif
endfor


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.