Getting to the Top of an InlineShape

C

Chuck

I need to find the Top and the Left positions of an inlinepicture so that I
can overlay the picture w/ an X image... using borders was my last attempt to
get these two locations... Any help is appreciated.

BTW: VS2008 and VSTO and this add-in is for Word 2007. It happens to be VB.

Dim ActiveDocument As Word.Document =
Globals.ThisAddIn.Application.ActiveDocument
Dim o As object = Globals.ThisAddIn.Application.Selection
Dim ils As Word.InlineShape =
Globals.ThisAddIn.Application.Selection.InlineShapes(1)
Dim iTop As Single = Convert.ToSingle(ils.Borders.DistanceFromTop)
Dim iLeft As Single = Convert.ToSingle(ils.Borders.DistanceFromLeft)
Dim iHeight As Single = Convert.ToSingle(ils.Height)
Dim iWidth As Single = Convert.ToSingle(ils.Width + 5)
Globals.ThisAddIn.Application.ActiveDocument.Shapes.AddPicture( _
"C:\Workarea\Source\ELNMarking\images\ELN XRectangleRed.PNG" _
,Core.MsoTriState.msoFalse _
,Core.MsoTriState.msoTrue _
,iLeft _
,iTop _
,iWidth _
,iHeight _
)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top