Hello.
I have this routine which pastes the object in active layer and aligns it to center of page:
Sub PasteAndAlignToPageCenter()
'paste and selectActiveLayer.Paste.AddToSelection 'this line gives run-time error 91
'align to page center ActiveSelectionRange.AlignAndDistribute cdrAlignDistributeHAlignCenter, cdrAlignDistributeVAlignCenter, cdrAlignShapesToCenterOfPageEnd Sub
Please help.
Thanks and regards.
Try PastEx
Dim s As Shape
Set s = ActiveLayer.Paste
If Not s Is Nothing Then s.AlignAndDistribute cdrAlignDistributeHAlignCenter, cdrAlignDistributeVAlignCenter, cdrAlignShapesToCenterOfPage
'paste and selectActiveLayer.Paste'ActiveLayer.Shapes.All.AddToSelection
'align to page centerActiveSelectionRange.AlignToPageCenter cdrAlignLeft + cdrAlignRight + cdrAlignTop + cdrAlignBottom, cdrTextAlignBoundingBoxEnd Sub