Sub GuidesAdd()
On Error Resume Next
Dim shp As Shape
Dim sld As Slide
Dim mySlide As Integer
Dim I As Long
'using the page setup of 10" wide (0-720) midpoint = 5.0 inches
' 7.5" tall (0-540) midpoint = 3.75 inches
' 1" = 72 pixels
' Position Values:
' x1 = 25.2 y1 = 48.96
' x2 = 342.72 y2 = 65.52
' x3 = 377.28 y3 = 102.96
' x4 = 694.80 y4 = 122.40
' y5 = 298.08
' y6 = 474.48
mySlide = ActiveWindow.View.Slide.SlideIndex
I = mySlide
'this part checks to see if the lines exist first, and if they do,
'it doesn't add more on top of the same location
For Each shp In ActivePresentation.Slides(mySlide).Shapes.Range
Select Case shp.Name
Case Is = "y1" & mySlide
shp.Delete
Exit Sub
End Select
Next shp
'This part draws the lines (top, left, width, height)
For Each sld In ActivePresentation.Slides(mySlide)
DoLine I, "y1", 48.96, 0, 720, 0
DoLine I, "y2", 65.52, 0, 720, 0
DoLine I, "y3", 102.96, 0, 720, 0
DoLine I, "y4", 122.4, 0, 720, 0
DoLine I, "y5", 298.08, 0, 720, 0
DoLine I, "y6", 474.48, 0, 720, 0
DoLine I, "x1", 0, 25.2, 0, 540
DoLine I, "x2", 0, 342.72, 0, 540
DoLine I, "x3", 0, 377.28, 0, 540
DoLine I, "x4", 0, 694.8, 0, 540
Next
End Sub
You may notice, that part where it checks to see if the lines exist first. Hopefully that helps your question a little bit.