问题
In Word document, there is an option in the insert image dialog box insert button that is "Link to File", where I can input a image url link into the file name input box. Word will then pull that image from the link. As such everytime the user opens the word document, it will pull that image from the link.
How do i do that with Microsoft Interop? Ive tried to use this method http://www.c-sharpcorner.com/uploadfile/hrojasara/insert-picture-with-hyperlink-in-word-file-using-C-Sharp/
However it saves the image to the file which i do not want to.
Hope someone can help. Thanks!
回答1:
Look at the documentation for the .AddPicture Method (https://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.inlineshapes.addpicture(v=office.15).aspx);
InlineShape AddPicture(
string FileName,
ref Object LinkToFile,
ref Object SaveWithDocument,
ref Object Range
)
You can easily set the parameters to achieve the desired results.
来源:https://stackoverflow.com/questions/32322438/programmatically-insert-image-to-word-with-link-to-file