Creating an appointment in outlook via automation

BennyGiebens
Member Posts: 43
As promised, here a simple example how to create an appointment via automation in someone else calender. One of the things i still need te know is how to set the flag "SHOW TIME AS", but i'll keep searching.
With thanks to Fozzie and his collegue !!!!!!!!
Automation Globals
Autapp:'Microsoft Outlook 9.0 Object Library'.Application
Autns:'Microsoft Outlook 9.0 Object Library'.NameSpace
Autrec:'Microsoft Outlook 9.0 Object Library'.Recipient
Autfolder:'Microsoft Outlook 9.0 Object Library'.MAPIFolder
autitem:'Microsoft Outlook 9.0 Object Library'.AppointmentItem
OCX Global
DATETIME OCX DateTimeConversion.DateTime
PS. This OCX is from the download on this site. Simply extract the ocx and register it in Financials
CREATE(Autapp);
Autns := Autapp.GetNamespace('MAPI');
Autrec := Autns.CreateRecipient('TESTUSER'); //Name used in mailserver
Autrec.Resolve;
Autfolder := Autns.GetSharedDefaultFolder(Autrec,9);
autitem := Autapp.CreateItem(1);
autitem.Subject('TESTSUBJECT');
stdate := '01/02/00';
sttime := '12:00:00';
DATETIME.SetStart(autitem,stdate,sttime);
sttime := '13:00:00';
DATETIME.SetEnd(autitem,stdate,sttime);
autitem.Move(Autfolder);
autitem.Close(0);
CLEAR(Autapp);
Hope that this is helpfull for someone !!
Rgds
Benny Giebens
[This message has been edited by BennyGiebens (edited 31-01-2000).]
With thanks to Fozzie and his collegue !!!!!!!!
Automation Globals
Autapp:'Microsoft Outlook 9.0 Object Library'.Application
Autns:'Microsoft Outlook 9.0 Object Library'.NameSpace
Autrec:'Microsoft Outlook 9.0 Object Library'.Recipient
Autfolder:'Microsoft Outlook 9.0 Object Library'.MAPIFolder
autitem:'Microsoft Outlook 9.0 Object Library'.AppointmentItem
OCX Global
DATETIME OCX DateTimeConversion.DateTime
PS. This OCX is from the download on this site. Simply extract the ocx and register it in Financials
CREATE(Autapp);
Autns := Autapp.GetNamespace('MAPI');
Autrec := Autns.CreateRecipient('TESTUSER'); //Name used in mailserver
Autrec.Resolve;
Autfolder := Autns.GetSharedDefaultFolder(Autrec,9);
autitem := Autapp.CreateItem(1);
autitem.Subject('TESTSUBJECT');
stdate := '01/02/00';
sttime := '12:00:00';
DATETIME.SetStart(autitem,stdate,sttime);
sttime := '13:00:00';
DATETIME.SetEnd(autitem,stdate,sttime);
autitem.Move(Autfolder);
autitem.Close(0);
CLEAR(Autapp);
Hope that this is helpfull for someone !!
Rgds
Benny Giebens
[This message has been edited by BennyGiebens (edited 31-01-2000).]
Rgds
Benny Giebens
Benny Giebens
0
Comments
-
Just remember where you've find the code !!! <img border="0" title="" alt="" src="images/smiles/icon_smile.gif" />Fozzie
May the source be with you0 -
The way I did it once was:
OutlookAftale.BusyStatus := Status;
Status is an option, with optiostring:
Availeble,For the time beeing,Busy,Out of office
* I'm not sure if my option string are right, as I am using a Danish Version <img border="0" title="" alt="" src="images/smiles/icon_smile.gif" />
Kind Regards
Henrik Helgesen,
Navision Solution Developer
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Great Minds Discuss Ideas,
Average minds discuss events
Small minds discuss people (With Malicious Intention)
Admiral Hyman Rickover, US Navy<HR></BLOCKQUOTE>0 -
Thnks Ernst, thats the property that does it.
Rgds
Benny GiebensRgds
Benny Giebens0 -
I tried the above code but its showing a run time error.
The call to Getshareddefaultfolder failed.MS Outlook returned the error OPeration Failed.
Please help0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions