NaamaV

Hi,

I've added controls(labels) to word document by creating Word Template dll, and I want to save their location on closing.

I've read here a solution that using word bookmarks, and I want to implement it, but I can't find the location of the control. I tried to write:

c.Select();

and then assign Application.Selection to Range object,

but the start point was always "0".

what is the right way to do it



Re: Visual Studio Tools for Office How can I find the location of a control?

NaamaV

I'm waiting for an answer.

It's very important for me.





Re: Visual Studio Tools for Office How can I find the location of a control?

Cindy Meister

Do these controls belong to the Shapes or InlineShapes collection

Are the controls added at design time, or at runtime






Re: Visual Studio Tools for Office How can I find the location of a control?

NaamaV

They added at runtime, and I don't know to which collection they belongs.

I wrote:

Microsoft.Office.Interop.Word.Selection currentSelection = Globals.ThisDocument.Application.Selection;

//Selecting the Range

rng = currentSelection.Range;

lblid += 1;

Globals.ThisDocument.Controls.AddControl(def.Deflbl, rng, def.Deflbl.Width, def.Deflbl.Height, def.Deflbl.Name + lblid);

rng.Select();

probably they saved in ThisDocument.Controls collection.





Re: Visual Studio Tools for Office How can I find the location of a control?

NaamaV

I'm waiting..