2015-03-19 59 views

回答

1

如果您想要替換的文本有有效的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); 
相關問題