c# - Drawing on VSTO WordDocument without saving shapes in the document -
we trying create vsto word 2013 document addin overlays visual indicators on document while user editing make them aware of problems information typing. seems can done drawing shapes such sample below. in our case, don't want these shapes saved document, want them available when editing document addin installed. can explain how can this?
private void drawit() { object orng = globals.thisdocument.application.selection.range; var doc = globals.thisdocument.innerobject; var shape = doc.shapes.addline(100f, 100f, 100f, 200f, ref orng); if (shape == null) return; shape.visible = microsoft.office.core.msotristate.msotrue; shape.line.dashstyle = microsoft.office.core.msolinedashstyle.msolinedash; shape.line.weight = 3; }
i'm 95% there's nothing in word object model that's going allow you're after. shapes, you've discovered, considered part of document. there no built-in mechanism displaying arbitrary shapes in other way. can manually managing own windows -- hwnd of window contains document, use win32 (and/or winforms/wpf) create the ui want display.
Comments
Post a Comment