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:

http://connect.microsoft.com/visualstudio/feedback/details/277090/adding-winform-controls-to-a-vsto-word-document-is-extremely-slow

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

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -