TPE

http://bayanbox.ir/view/263405954590585756/2mobile.png

Tavvafi@gmail.com


≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡

Sub CurrentSlide()
   ' This subroutine calls FrameASlide and passes it
   ' the current active slide.
    Call FrameASlide(ActiveWindow.Selection.SlideRange(1))
End Sub

Sub AllSlides()
   ' This calls FrameASlide for each slide in the presentation
   Dim oSld as Slide
   For Each oSld in ActivePresentation.Slides
      Call FrameASlide(oSld)
   Next
End Sub

Sub FrameASlide(oSld as Slide)

    Dim sngLinewidth As Single
    Dim oFrameShape As Shape
    Dim sngSlidewidth As Single
    Dim sngSlideheight As Single
    Dim oSld As Slide
    Dim sngOffset As Single

    ' EDIT:
    sngLinewidth = 2    ' frame outline thickness in points
    ' NO MORE EDITS

    sngOffset = sngLinewidth / 2

    With ActivePresentation.PageSetup
        sngSlidewidth = .Slidewidth
        sngSlideheight = .Slideheight
    End With

    With oSld
        Set oFrameShape = .Shapes.AddShape(msoShapeRectangle, _
            0 + sngOffset, _
            0 + sngOffset, _
             sngSlidewidth - sngOffset, _
             sngSlideheight - sngOffset)
    End With

    With oFrameShape
        With .Line
            .Weight = sngLinewidth
            .ForeColor.RGB = RGB(0, 0, 0)   ' black
        End With
        With .Fill
            .Visible = msoFalse
        End With
    End With

End Sub