sel.TypeText(_T(\
sel.MoveRight(COleVariant((short)1),COleVariant(short(1)),COleVariant(short(0)));
sel.TypeText(_T(\
sel.MoveRight(COleVariant((short)1),COleVariant(short(1)),COleVariant(short(0)));
sel.TypeText(_T(\
sel.MoveRight(COleVariant((short)1),COleVariant(short(1)),COleVariant(short(0)));
sel.TypeText(_T(\
sel.MoveRight(COleVariant((short)1),COleVariant(short(1)),COleVariant(short(0)));
sel.TypeText(_T(\
sel.MoveRight(COleVariant((short)1),COleVariant(short(1)),COleVariant(short(0)));
sel.TypeText(_T(\
sel.MoveRight(COleVariant((short)1),COleVariant(short(1)),COleVariant(short(0)));
sel.TypeText(_T(\
sel.MoveRight(COleVariant((short)1),COleVariant(short(1)),COleVariant(short(0)));
sel.TypeText(_T(\
sel.MoveRight(COleVariant((short)1),COleVariant(short(1)),COleVariant(short(0)));
sel.TypeText(_T(\
sel.MoveRight(COleVariant((short)1),COleVariant(short(1)),COleVariant(short(0)));
sel.TypeText(_T(\int i=0,j=0;
for(i=2;i<7;i+=2) { Cell c1=table.Cell(i,1); Cell c2=table.Cell(i+1,1); c1.Merge(c2); c1.ReleaseDispatch(); c2.ReleaseDispatch(); }
Cell c;
CString strName[]={\for(j=0,i=0;i<3;++i,j+=2) { c=table.Cell(j+2,1); c.Select(); Cells cs=sel.GetCells();
cs.SetVerticalAlignment(1); sel.TypeText(strName[i]); sel.MoveDown(COleVariant((short)5),COleVariant(short(1)),COleVariant(short(0))); cs.ReleaseDispatch(); c.ReleaseDispatch(); }
c=table.Cell(7,1); c.Select();
for(i=0,j=0;i<6;++i,++j) { if(i%2==0) j=0; sel.TypeText(strDate[j]); sel.MoveUp(COleVariant((short)5),COleVariant(short(1)),COleVariant(short(0))); }
c.ReleaseDispatch(); app.SetVisible(TRUE); table.ReleaseDispatch(); tables.ReleaseDispatch(); sel.ReleaseDispatch(); docs.ReleaseDispatch(); saveDoc.ReleaseDispatch(); app.SetVisible(TRUE); app.ReleaseDispatch(); }
运行一下看看版面比以前好多了吧