c# word文档插入图片,有一台机器设置无效,其余机器设置成功,这是为什么?

代码如下:

                      object range = wordDoc.Paragraphs.Last.Range;
        object linkToFile = false;               //默认
        object saveWithDocument = true;               //默认

        string dir = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
        InlineShape inlineShape = wordDoc.InlineShapes.AddPicture(dir + "\\test.jpg", ref linkToFile, ref saveWithDocument, ref range);//向文档中插入图片
        if (inlineShape.Height >= 300)
        {
            inlineShape.Width = inlineShape.Width * 300 / inlineShape.Height;
            inlineShape.Height = 300;
        }
        if (inlineShape.Width >= 300)
        {
            inlineShape.Height = inlineShape.Height * 300 / inlineShape.Width;
            inlineShape.Width = 300;
        }
        //Shape cShape = inlineShape.ConvertToShape();
        inlineShape.ConvertToShape().WrapFormat.Type = WdWrapType.wdWrapInline;//设置嵌入型

        //cShape.ZOrder(Microsoft.Office.Core.MsoZOrderCmd.msoSendBehindText);
        //cShape.WrapFormat.Type = WdWrapType.wdWrapInline;
        wordApp.Selection.Text = "";
        wordApp.Selection.Paragraphs.OutlineLevel = WdOutlineLevel.wdOutlineLevelBodyText;
        wordApp.Selection.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter;
        wordApp.Selection.EndKey(6, 0);
        wordApp.Selection.Font.Name = "仿宋_GB2312";
        wordApp.Selection.Font.Name = "Times New Roman";
        wordApp.Selection.Font.Size = 16;
        wordApp.Selection.ParagraphFormat.LineSpacing = 18F;
        wordApp.Selection.Text = "\n";

有没有大神解释一下,主要是嵌入型格式设置失败,word大版本都是2010版。

这个要看这台机器和别的机器有什么不同。比如是否安装了杀毒软件,文件系统的路径权限,字体,office组件是否丢失等等