-
April 19th, 2013, 10:32 AM
#1
Macro for insert oval shape in table cell (word 2007)
Hi everyone!
I'm building a macro for inserting a oval shape in the current selected cell of a table. That is: the cell isn't selected but the cursor is at the cell where I want to insert the shape.
The thing is that i want it to be placed at an exact point of that cell but the macro doesn't recognize it. It recognizes the page and places the shape in the point I determine but relatively to the page instead of the current cell.
So I have the following code. What's wrong with it?
Thanks to anyone who can help me!
Ricardo
Sub InsWhiteTurn()
On Error GoTo ErrorHandler
Set sh = ActiveDocument.Shapes.AddShape(Type:=msoShapeOval, _
Left:=0, Top:=0, Width:=CentimetersToPoints(0.4), Height:=CentimetersToPoints(0.4))
With sh
.Line.Weight = 0.75
.Line.ForeColor = vbBlack
.Fill.ForeColor = vbWhite
.WrapFormat.Type = wdWrapNone
.LayoutInCell = True
.RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
.Left = CentimetersToPoints(8)
.RelativeVerticalPosition = wdRelativeVerticalPositionParagraph
.Top = CentimetersToPoints(6.15)
End With
Exit Sub
ErrorHandler:
End Sub
PS: I'm using open explicit to determine my variables
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|