0
如何在word文檔中查找文本並用圖片替換文本?我知道如何用文字替換文字,但無論如何都要用文字替換文字?C# - Microsoft word interop find text替換爲圖片
如何在word文檔中查找文本並用圖片替換文本?我知道如何用文字替換文字,但無論如何都要用文字替換文字?C# - Microsoft word interop find text替換爲圖片
如果您想要替換的文本有有效的Word.Range
對象,則可以使用InlineShapes.AddPicture()
。
例如:
// Get the Range for the text you want to replace, which you claim to be able to do already.
Word.Range selectedText = GetTextToReplace();
// Clear the existing text, otherwise the image will just be appended after the text.
selectedText.Text = "";
// Insert the image.
selecetdText.InlineShapes.AddPicture(imagePath, Type.Missing, true, Type.Missing);
你對與文本進行替換什麼碼? – musefan 2015-03-19 10:34:34