Adding a WinForm control to a Word Document using VSTO -
i'd add labels word document, in margin. i've seen things date pickers , combo boxes can added document, can't see i'm after.
i can controlcollection object via:
globals.factory.getvstoobject(myapplication.activedocument).controls
but there no methods adding labels.
are there alternative methods adding labels document using vsto?
[edit]
so managed insert winform labels, extremely slow, confirmed in post:
so i'm still looking alternatives. cannot find label-like contentcontrols suggested in thread above.
so solution settled on use word shapes. snippet of code below shows how add label shape document.
shape shape = doc.shapes.addlabel(office.msotextorientation.msotextorientationhorizontal, left, top, width, height, range);
the process of adding multiple labels no means lightning fast, faster adding winform controls document. shapes give flexibility place wherever want on page too, contentcontrols not offer.
Comments
Post a Comment