问题
I am using a word document which has a bookmark inside that. My requirment is to insert an icon after each bookmark using OpenXML 2.0 with C# 4.0.
I tried to use Image content control and the reflected code from OpenXMLSDK tool. Somehow it got worked but now I am getting the full size controls. Also each image has an icon into that for change picture. Can anyone tell me that how can I reduce the size of the picture content control and if possible remove that extra icon.
Also, if anyone has better idea to insert the icon after each bookmark? Somehow inserting an image using OpenXML is not that developer friendly.
Please help on this.
回答1:
The best way to learn how to do something in Open XML is to use - Open XML SDK 2.0 Productivity Tool. You could insert the icons you need manually in MS Word first, save the document and them - open this file in Open XML SDK 2.0 Productivity Tool (which is a part of Open XML SDK 2.0). Then - find the bookmarks and icons you inserted and see how to do that programmaticaly:

Hope that helps!
来源:https://stackoverflow.com/questions/9383998/how-to-insert-an-image-in-word-after-a-bookmark-using-openxml