В класс ComExcelDocument добавьте
X++:
void setMargins(int _sheetNumber = 1,
real _leftMargin = 0, real _rightMargin = 0,
real _topMargin = 0, real _bottomMargin = 0)
{
COM comColumns, comWorkSheet, comPageSetup, comColumn;
COMVariant comColumnVariant;
;
if (m_comDocument)
{
comWorkSheet = this.getWorkSheet(_sheetNumber);
comPageSetup = comWorkSheet.pageSetup();
comPageSetup.leftMargin(_leftMargin);
comPageSetup.rightMargin(_rightMargin);
comPageSetup.topMargin(_topMargin);
comPageSetup.bottomMargin(_bottomMargin);
}
}