need to understand this and make rest move

Parag Goyal 1 Reputation point
2021-09-30T16:30:43.77+00:00

I need to understand this code which help to touch the guidelines to the right side also want to learn the other move which helps to touch the rest sides of the shape

Sub TouchRight()
Dim SR As ShapeRange
Dim G As Shape
Dim X As Double
Dim Position
Set SR = ActiveSelectionRange
ActiveDocument.Unit = cdrMillimeter

Position = ActiveDocument.MasterPage.GuidesLayer.Shapes.All.RightX

If ActiveDocument.MasterPage.GuidesLayer.Shapes.Count > 0 Then
For Each G In ActiveDocument.MasterPage.GuidesLayer.Shapes
If G.CenterX > ActiveSelectionRange.RightX Then
If G.CenterX < Position Then
Position = G.CenterX
End If
End If
Next G
End If

SR.SetSizeEx SR.LeftX, SR.CenterY, Position - SR.LeftX, SR.SizeHeight
End Sub

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,581 questions
{count} votes