当前位置:编程学习 > C#/ASP.NET >>

C# EXCEL导出写入图片报错

如题,在做导出的写入图片的方法

在运行的时候报“picture的insert方法无效”,
顺便问哈大神们有没好办法解决数字类型导出的时候自动右对齐的方法,因为是报告的打印,所以不能使用前面加“'”的方法 c# 图片 EXCEL 导出 文本对齐 --------------------编程问答--------------------   private void AddPicture(string FileName, int TableIndex, int CellRow, int CellColumn)
        {
            if (string.IsNullOrEmpty(FileName)) return;
            wordApp.ActiveDocument.Tables[TableIndex].Cell(CellRow, CellColumn).Select();
            object LinkToFile = false;
            object SaveWithDocument = true;
            object Anchor = wordApp.Selection.Range;
            wordApp.ActiveDocument.InlineShapes.AddPicture(FileName, ref LinkToFile, ref SaveWithDocument, ref Anchor);
            //将图片设置为四周环绕型
           // Word.Shape s = wordApp.ActiveDocument.InlineShapes[1].ConvertToShape();
           // s.WrapFormat.Type = Word.WdWrapType.wdWrapSquare;

        } --------------------编程问答-------------------- 用这个方法吧,我所做的都是这个方法,其中Tableindex是页数。 int CellRow, int CellColumn决定单元格位置 --------------------编程问答-------------------- 奥对了这个是word的,Excel的方法和他类似,只是类库不一样 --------------------编程问答--------------------
引用 3 楼 xingfei2010 的回复:
奥对了这个是word的,Excel的方法和他类似,只是类库不一样
我试了貌似不行的呢,点不出来你写的那个Selection.Range方法
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,