AXForum  
Go Back   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Forgotten Your Password?
Register Forum Rules FAQ Members List Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Old 30.04.2008, 23:07   #1  
Blog bot is offline
Blog bot
Участник
 
25,646 / 848 (80) +++++++
Join Date: 28.10.2006
dax-lessons: Create Outlook Appointment or Meeting Request using X++
Источник: http://DAX-Lessons.spaces.live.com/B...FCD1!153.entry
==============

If you need to create an appointment or meeting request in Outlook using X++, just borrow the code below. Outlook client needs to be installed on themachine where the code is run.

Here is the job.

X++:
static void OutlookAppointment(Args _args)
{
   COM        sysOutlookCollection;
   COM        collection;
   COMVariant comStartDate = new COMVariant();
   COMVariant comEndDate   = newCOMVariant();
   COM        c;
   #SysOutLookCOMDEF
   #define.mapi("MAPI")
   #define.outlook("Outlook.Application")
   COM        sysOutlook;
   COM        sysOutlookNameSpace;
   COM        sysOutlookMAPIFolder;
    ;
   sysOutlook                  = newCOM(#outlook);
   sysOutlookNameSpace         = sysOutlook.getNamespace(#mapi);
   sysOutlookNameSpace.logon();
   sysOutlookMAPIFolder        =sysOutlookNameSpace.getDefaultFolder(#OlDefaultFolders_olFolderCalendar);
   collection                  =sysOutlookMAPIFolder.items();
    c =collection.add();
   comStartDate.date(today());
   comStartDate.time(str2Time( "12:00:00"));
   comEndDate.date(today());
   comEndDate.time(str2Time( "12:45:00"));
   c.location('Solugenix 4th Floor Conference Room, India');
   c.subject('Meeting regd Microsoft Dynamics AX 2009');
   c.body('Lets discuss on whats new in DAX 2009');
   c.start(comStartDate);
   c.end(comEndDate);
   c.save();
    if (c)
    {
       c.display();
       info("The action is created in Microsoft Outlook");
    }
    else
       throw error("@SYS31969");
       sysOutlookNameSpace.logoff();
}



Источник: http://DAX-Lessons.spaces.live.com/B...FCD1!153.entry
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Similar Threads
Thread Thread Starter Forum Replies Last Post
dax-lessons: Generate XML Documentation Files for a project - DAX 2009 Blog bot DAX Blogs 0 08.08.2008 19:06
dax-lessons: Create HTML using HtmlTextWriter class in x++ Blog bot DAX Blogs 0 15.04.2008 20:05
dax-lessons: Create Technical Document from AX Blog bot DAX Blogs 0 12.03.2008 09:05
dax-lessons: Document Handling in AX - setup and Example Blog bot DAX Blogs 0 27.08.2007 23:00
dax-lessons: Active directory in Axapta Blog bot DAX Blogs 0 27.08.2007 23:00

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Рейтинг@Mail.ru
All times are GMT +3. The time now is 00:50.
Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Contacts E-mail, Advertising.