Показать сообщение отдельно
Старый 14.05.2007, 14:47   #1  
FiGr is offline
FiGr
Axapta Retail User
Axapta Retail User
 
13 / 10 (1) +
Регистрация: 30.12.2004
Адрес: Иваново
Разделитель страницы в MS WORD
Подскажите как вставить разделитель страницы
при выводе в MS word по условию.

X++:
static void (Args _args)
{

    COM         WordApplication;
    COM         WordDocuments;
    COM         WordDocument;
    COM         WordRange;
    COM         WordTables;
    COM         WordTable;
    COM         WordTableCell;
    int         row, col;
    int         total;
    int         idx;
    InventTable     InventTable;
    COM     TableRow;
    com     TableRange;
    ;

    total++;
    col++;
    idx++;
    
    WordApplication = new COM("word.application");
    WordApplication.visible(true);
    WordDocuments   = WordApplication.Documents();
    WordDocument    = WordDocuments.Add();
    WordDocument.Activate();
    WordRange = WordDocument.range(0,0);
    WordTables = WordRange.Tables();

    while select InventTable       
    {        
    if (total == 1)
    {
        row++;
        WordTable = WordTables.Add(WordRange,2,2);
        TableRow  = WordTable.Rows();
    }
    else
        if ((total div 2) != (total/2))
        {
            TableRow    = WordTable.Rows();
            TableRow = TableRow.Add();
            row++;
        }

    WordTableCell   = WordTable.Cell(row, col);
    WordRange       = WordTableCell.Range();
    WordRange.Insertafter(strfmt("Номенклатура: %1 \n",_name));
    WordRange.Insertafter(strfmt("Описание: %1 ", _descr));

    if (col==2)
        col = 0;    
if (idx ==12)
{
//Не получается перевести на новую страницу
WordRange.InsertBreak(0);
}


}
}