现在想向excel中插入图片,希望大家给点思路,最好能提供些源码参考,谢谢了!

解决方案 »

  1.   

    Excel.Worksheet xSheet=(   Excel.Worksheet)xBook.Sheets[1];  
    xSheet.Shapes.AddPicture("D:\\tt.bmp", MsoTriState.msoFalse  , 
    MsoTriState.msoTrue,10,10,150,150);
      

  2.   

    IEnumerator enumerator1 = inlineShapes.GetEnumerator();
    enumerator1.Reset();
    enumerator1.MoveNext();
    InlineShape inlineShape = enumerator1.Current as InlineShape;
    Shape curShape = inlineShape.ConvertToShape();
    enumerator1 = null;
    if (curShape == null) return;
    object left = curShape.Left;
    object top = curShape.Top;
    object width = curShape.Width;
    object height = curShape.Height;
    object anchor = curShape.Anchor;
    object missing = Type.Missing;

    Word.Shape newShape = shapes.AddPicture(imageName, ref missing, ref missing, 
    ref left, ref top, ref width, ref height, ref anchor);
    curShape.Delete();
      

  3.   

    插入 文字 你就要在word模版中 建立你要的文字型窗体域
    我这些代码都是office 2000的
    /// <summary>
    /// 填充Word文件的字段值
    /// </summary>
    /// <param name="fieldName">字段名</param>
    /// <param name="newValue">要显示的字段名的具体值</param>
    public void FillFieldValueToWord(string fieldName, string newValue)
    {
    Object itemName = fieldName;
    Word.FormField field = formFields.Item(ref itemName);
    if (field == null)  return; string strResult = field.Result.ToString();
    string fieldValue = newValue; // 对于不够长度的在后面加空格
    if (strResult.Length > newValue.Length)
    fieldValue = fieldValue.PadRight(strResult.Length,' '); field.Result = fieldValue;
    }
      

  4.   

    Excel和Word的操作有何区别呢?
      

  5.   

    关注和学习中,碰到了和你相似的问题
    希望将一群图片和相对应的文字生成Excel表