AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 21.12.2007, 04:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,497 / 847 (79) +++++++
Регистрация: 28.10.2006
axStart: Office Com Integration
Источник: http://axstart.spaces.live.com/Blog/...C0A0!208.entry
==============


Some people find it hard to write integration with Office. Well it is not as hard as you expect. In below scripts are some examples shown.

static void ExampleExcel(Args _args)
{
    SysExcelApplication     excel;
    SysExcelWorkbooks       books;
    SysExcelWorkbook        book;
    SysExcelWorksheets      sheets;
    SysExcelWorksheet       sheet;
    SysExcelCells           cells;
    SysExcelCell            cell;

    ; 
    excel = SysExcelApplication::construct();
 
    books = excel.workbooks();
    book = books.add();
 
    sheets = excel.worksheets();
    sheet = sheets.itemFromNum(1);
    sheet.name("My Sheet");
 
    cells = sheet.cells();
 
    cell = cells.item(1,1);
    cell.value(1000);
 
    cell = cells.item(2,1);
    cell.value(500);
 
    cell = cells.item(3,1);
    cell.value('=SUM(A1,A2)');
 
    excel.visible(true);
}
static void ExampleWord(Args _args)
{

    COM     wordApplication;
    COM     wordDocuments;
    COM     wordDocument;
    COM     wordRange;
    ;
    wordApplication = new COM("word.application");
    wordApplication.visible(TRUE);
    wordDocuments   = wordApplication.Documents();
 
    wordDocument    = wordDocuments.add();
    wordDocument.saveas("c:\Axapta COM Document1.doc");
    wordDocument.activate();
 
    wordRange = wordDocument.range(0,0);
    wordRange.insertafter("Hello from Axapta.");
    wordRange.bold(true);
 
    wordDocument.save();
    wordDocument.close();
    wordApplication.quit();
}
static void ExampleOutlook(Args _args)
{
    COM     outLookAppl;
    COM     newTask;
 
    //Initialize the com outlook object
    outLookAppl = new com("OutLook.application");
 
    //Creates and task object
    newTask  = outLookAppl.CreateItem(3);
 
    newTask.subject("Approve requisition");
 
    newTask.startDate(systemDateGet()+1);
    newTask.dueDate(systemDateGet()+3);
 
    //In progress
    newTask.status("1");
 
    //Initiate reminder
    newTask.ReminderSet(true);
 
    //Play sounds when reminders needs to be send
    newTask.ReminderPlaySound("True");
 
    //Default reminder sound is chosen
    newTask.ReminderOverrideDefault("false");
 
    newTask.body("Requisition RQ2003 ready for approval.");
 
    newTask.categories("Requisition");
 
    newTask.totalWork("2");
 
    //Display the new task to screen
    newTask.display();
}
 


Источник: http://axstart.spaces.live.com/Blog/...C0A0!208.entry
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axStart: Dynamics AX and Office Business Applications (OBA) Blog bot DAX Blogs 0 27.10.2008 16:05
axStart: Microsoft Office Interactive Developer Map Blog bot DAX Blogs 0 14.10.2008 19:05
AX UK: New PPT showcasing Dynamics AX and 2007 Office System Integration Blog bot DAX Blogs 0 05.03.2007 17:10

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 08:12.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.