A
AutomationGuy
Hi I´m doing some automation of word document, and I need to erease a object
picture and add a new one with the same attributes of that one already
erased, but when the object is not placed at the first page when I insert the
new object it always go to the first page I have this code:
dLineWeight = objShape.Line.Weight
lLineStyle = objShape.Line.Style
lLineVisible = objShape.Line.Visible
dLineTransparency = objShape.Line.Transparency
' Save the color details of the original socket.
lFillColor = objShape.Fill.ForeColor.RGB
lLineForeColor = objShape.Line.ForeColor.RGB
' Save all the properties of the place holder.
nLeft = objShape.Left
nTop = objShape.Top
nSocketHeight = objShape.Height
nSocketWidth = objShape.Width
objShape.LockAnchor = True
lHoriRelativePos = objShape.RelativeHorizontalPosition
lVertRelativePos = objShape.RelativeVerticalPosition
lPhotoWrapType = objShape.WrapFormat.Type
lPhotoAllowOverlap = objShape.WrapFormat.AllowOverlap
objShape.Anchor.Select
' Collapse the selection
Selection.Collapse (wdCollapseEnd)
Set NewShape =
m_objDocument.Shapes.AddOLEObject(Anchor:=Selection.Range,
ClassType:="DIYPhot
bject", FileName _
:="", LinkToFile:=False, DisplayAsIcon:=False)
As you can see I used collapse to get at the correct page but when I added
the new object is alwast go to the first page. I don´t know what to do.
thank you in advance.
Another thing that I would like to know is how can I get the actual posicion
of pointer. I mean to know in which page I am and the line and colum in the
page.
Thanks again.
picture and add a new one with the same attributes of that one already
erased, but when the object is not placed at the first page when I insert the
new object it always go to the first page I have this code:
dLineWeight = objShape.Line.Weight
lLineStyle = objShape.Line.Style
lLineVisible = objShape.Line.Visible
dLineTransparency = objShape.Line.Transparency
' Save the color details of the original socket.
lFillColor = objShape.Fill.ForeColor.RGB
lLineForeColor = objShape.Line.ForeColor.RGB
' Save all the properties of the place holder.
nLeft = objShape.Left
nTop = objShape.Top
nSocketHeight = objShape.Height
nSocketWidth = objShape.Width
objShape.LockAnchor = True
lHoriRelativePos = objShape.RelativeHorizontalPosition
lVertRelativePos = objShape.RelativeVerticalPosition
lPhotoWrapType = objShape.WrapFormat.Type
lPhotoAllowOverlap = objShape.WrapFormat.AllowOverlap
objShape.Anchor.Select
' Collapse the selection
Selection.Collapse (wdCollapseEnd)
Set NewShape =
m_objDocument.Shapes.AddOLEObject(Anchor:=Selection.Range,
ClassType:="DIYPhot
:="", LinkToFile:=False, DisplayAsIcon:=False)
As you can see I used collapse to get at the correct page but when I added
the new object is alwast go to the first page. I don´t know what to do.
thank you in advance.
Another thing that I would like to know is how can I get the actual posicion
of pointer. I mean to know in which page I am and the line and colum in the
page.
Thanks again.