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 _
)
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 _
)