test = new CCWordApp();
test.Open(temppath);
test.GotoBookMark("imgBar1");
test.InsertImage(barFileName, 90, 30);
public void InsertImage(string strPicPath, float picWidth, float picHeight)
{
string FileName = strPicPath;
object LinkToFile = false;
object SaveWithDocument = true;
object Anchor = oWordApplic.Selection.Range;
InlineShape inlineShape = oWordApplic.Selection.InlineShapes.AddPicture(FileName, ref LinkToFile, ref SaveWithDocument, ref Anchor);
inlineShape.Width = picWidth;
inlineShape.Height = picHeight;
}
在線求解,剛開始除錯可以向word檔案對應標簽的單元格插入圖片,但是后面就一直報錯了,是什么原因?
按照網上:1. 在控制面板--->管理工具--->服務 中,開啟Distributed Transaction Coordinator 服務。
2. 打開控制面板--->管理工具--->組件服務--->選擇計算機--->我的電腦--->右擊屬性--->選擇MSDTC--->選擇安全配置 勾選事務管理器通信中的允許出站、允許入站和不要求進行驗證。
試了也不行
uj5u.com熱心網友回復:
都沒人嗎?有沒有大神,試了很多方法還是沒解決!!uj5u.com熱心網友回復:
請問現在你說的這個問題解決了么?我也碰到了這個問題,無法進行了,求指導uj5u.com熱心網友回復:
如果 有另外開啟執行緒來跑呢個 gp.Execute(tool,null) 會出現上面的問題的,試著不用另啟用執行緒 直接是主執行緒處理。轉載請註明出處,本文鏈接:https://www.uj5u.com/net/107482.html
標籤:C#
