日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

淺析C#編程實現(xiàn)動態(tài)生成Word文檔(2)_.Net教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

推薦:淺析Asp.net2.0之自定義控件ImageButton
前言 上個星期三開始學自定義控件,做了不少練習�;艘簧衔鐣r間寫了一個imageButton,以前就像寫這個控件,只是不會。 圖片 正文 這個控件模仿winform中的button,可以支持圖片和文字�?梢赃x擇執(zhí)行服務器端程序還是客戶端程序,還有一些簡單的設置。 不足

 

   // 填充表格內(nèi)容

    newTable.Cell( 2 ,  1 ).Range.Text  =   " 產(chǎn)品基本信息 " ;

    newTable.Cell( 2 ,  1 ).Range.Font.Color  =  Word.WdColor.wdColorDarkBlue; // 設置單元格內(nèi)字體顏色

    // 合并單元格

    newTable.Cell( 2 ,  1 ).Merge(newTable.Cell( 2 ,  3 ));

    WordApp.Selection.Cells.VerticalAlignment  =  Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter;

    // 填充表格內(nèi)容

    newTable.Cell( 3 ,  1 ).Range.Text  =   " 品牌名稱: " ;

    newTable.Cell( 3 ,  2 ).Range.Text  =  BrandName;

    // 縱向合并單元格

    newTable.Cell( 3 ,  3 ).Select(); // 選中一行

    object  moveUnit  =  Word.WdUnits.wdLine;

    object  moveCount  =   5 ;

    object  moveExtend  =  Word.WdMovementType.wdExtend;

    WordApp.Selection.MoveDown( ref  moveUnit,  ref  moveCount,  ref  moveExtend);

    WordApp.Selection.Cells.Merge();

    // 插入圖片

    string  FileName  =  Picture; // 圖片所在路徑

    object  LinkToFile  =   false ;

    object  SaveWithDocument  =   true ;

    object  Anchor  =  WordDoc.Application.Selection.Range;

    WordDoc.Application.ActiveDocument.InlineShapes.AddPicture(FileName,  ref  LinkToFile,  ref  SaveWithDocument,  ref  Anchor);

    WordDoc.Application.ActiveDocument.InlineShapes[ 1 ].Width  =  100f; // 圖片寬度

    WordDoc.Application.ActiveDocument.InlineShapes[ 1 ].Height  =  100f; // 圖片高度

    // 將圖片設置為四周環(huán)繞型

    Word.Shape s  =  WordDoc.Application.ActiveDocument.InlineShapes[ 1 ].ConvertToShape();

    s.WrapFormat.Type  =  Word.WdWrapType.wdWrapSquare;

    newTable.Cell( 12 ,  1 ).Range.Text  =   " 產(chǎn)品特殊屬性 " ;

    newTable.Cell( 12 ,  1 ).Merge(newTable.Cell( 12 ,  3 ));

    // 在表格中增加行

    WordDoc.Content.Tables[ 1 ].Rows.Add( ref  Nothing);

    WordDoc.Paragraphs.Last.Range.Text  =   " 文檔創(chuàng)建時間: "   +  DateTime.Now.ToString(); // “落款”

    WordDoc.Paragraphs.Last.Alignment  =  Word.WdParagraphAlignment.wdAlignParagraphRight;

    // 文件保存

    WordDoc.SaveAs( ref  filename,  ref  Nothing,  ref  Nothing,  ref  Nothing,  ref  Nothing,  ref  Nothing,  ref  Nothing,  ref  Nothing,  ref  Nothing,  ref  Nothing,  ref  Nothing,  ref  Nothing,  ref  Nothing,  ref  Nothing,  ref  Nothing,  ref  Nothing);

    WordDoc.Close( ref  Nothing,  ref  Nothing,  ref  Nothing);

    WordApp.Quit( ref  Nothing,  ref  Nothing,  ref  Nothing);

    message = name + " 文檔生成成功,以保存到C:CNSI下 " ;

    }

    catch

    ... {

    message  =   " 文件導出異常! " ;

    }

    return  message;

    }

 

分享:淺談.net程序員,該不該學IL?
最近一直在思考一個問題,那就是.net程序員的發(fā)展,應該往上走還是往下走的事情。所謂往上走,我的理解是朝著系統(tǒng)架構(gòu)方向發(fā)展,從原來的編碼工作轉(zhuǎn)向架構(gòu)、設計、分析等等工作。 而往下走,是研究.net底層原理和實現(xiàn),可能大部分就是對IL和CLR的研究。 最近

共2頁上一頁12下一頁
來源:模板無憂//所屬分類:.Net教程/更新時間:2009-10-04
相關(guān).Net教程