Last active
February 18, 2016 16:33
-
-
Save DevPicon/aae61e0ab3a445984c98 to your computer and use it in GitHub Desktop.
Code to apply some customizations to Powepoint objects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub configure_animations() | |
Dim oshp As Shape | |
Dim osld As Slide | |
Set oshp = ActiveWindow.Selection.ShapeRange(1) | |
Set osld = Application.ActiveWindow.View.Slide | |
' Add entering effect to shape oshp | |
osld.TimeLine.MainSequence.AddEffect oshp, msoAnimEffectFade, , msoAnimTriggerOnPageClick | |
' Apply the same effect but set Exiting flag on TRUE | |
Dim effMain As Effect | |
Set effMain = osld.TimeLine.MainSequence.AddEffect(oshp, msoAnimEffectFade, , msoAnimTriggerOnPageClick) | |
effMain.Exit = msoTrue | |
End Sub |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub configure_square() | |
Dim oshp As Shape | |
Set oshp = ActiveWindow.Selection.ShapeRange(1) | |
' Validate if the object is a shape | |
If oshp.Type = msoAutoShape Then | |
oshp.Line.Weight = 1.5 | |
oshp.Line.Style = msoLineSingle | |
oshp.Line.ForeColor.RGB = RGB(57, 197, 231) | |
' Activate transparency | |
oshp.Fill.Transparency = 1 | |
End If | |
End Sub |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub massive_resize() | |
Dim oshp As Shape | |
Set oshp = ActiveWindow.Selection.ShapeRange(1) | |
' Validate if the object is a picture | |
If oshp.Type = msoPicture Then | |
oshp.LockAspectRatio = msoTrue | |
' We have to convert each centimeter in points (1 cm = 28.34 pts) | |
oshp.Width = 22.8 * 28.34 | |
' Center image in slide | |
oshp.Left = ActivePresentation.PageSetup.SlideWidth / 2 - oshp.Width / 2 | |
oshp.Top = ActivePresentation.PageSetup.SlideHeight / 2 - oshp.Height / 2 | |
oshp.Line.Weight = 1.5 | |
oshp.Line.Style = msoLineSingle | |
oshp.Line.ForeColor.RGB = RGB(57, 197, 231) | |
End If | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code let me apply a format to selected image into a slide