Показать сообщение отдельно
Старый 15.04.2010, 12:51   #3  
kair84 is offline
kair84
Участник
 
47 / 58 (2) ++++
Регистрация: 15.04.2010
Адрес: Belarus
да смотрел, вот код:
X++:
//Import from Mazzy forum
public void InsertText(BookMark      _bookMark,
                          TextBuffer    _text,
                          int           _workSheet = 1)
{
  COM         XLSWorkSheet, XLSrange;
  TextBuffer  tempBuffer;             // To store clipboard contents
  ;

    if (! m_comDocument)
    {
      throw error(StrFmt("@DIS6401", this.getApplicationName()));
    }
    else
    {
      // Initializing XLSWorkSheet object
      XLSWorkSheet    = this.getWorkSheet(_workSheet);
      if (!XLSWorkSheet)
        throw error("@DIS6043");

      // Initializing XLSRange object
      XLSrange        = this.findRange(_bookMark,_workSheet);
      if (!XLSrange)
        throw error("@SYS27391");
      XLSrange.select();


      // Storing clipboard contents
      tempBuffer = new TextBuffer();
      tempBuffer.fromClipboard();


      // Preparing text to be inserted
      _text.toClipboard();     

      // Inserting text from clipboard

      XLSWorkSheet.pasteSpecial(1); // 1 - "Text only" mode  
//      XLSWorkSheet.pasteSpecial(3); 
//      XLSWorkSheet.PasteSpecial(COMVariant::createFromStr("Текст"));
//        XLSWorkSheet.pasteSpecial(-4163);


      // Restoring clipboard contents
      tempBuffer.toClipboard();
    }// if

  return;
}