Working on Macros for PowerPoint

Hi I have few questions which i have asked in attached PPT file. Let me know if this is okay to put my request in this way...
Amitesh SinhaAsked:
Who is Participating?
 
Eric WoodfordSoftware Systems Specialist 3Commented:
Just a heads up, macros can be useful in Office documents, but many Anti-virus solutions will block these attachments as viruses. So emailing them will often cause them to be deleted or not delivered at all.
0
 
Jamie GarrochPowerPoint Consultant & DeveloperCommented:
@Eric : Does that happen even if the VBA project is digitally signed with an AuthentiCode certificate issued by a root-CA authority which is intended to identify the publisher as a legitimate entity?

@Amitech : I know that EE [still] does not permit the upload of macro-enabled PowerPoint files, even though they allow macro-enabled Excel files! So the best workaround I have is to simply add the .zip extension on the end of your file name e.g. myFile.pptm becomes myFile.pptm.zip and then you can upload it to this question.
0
 
Eric WoodfordSoftware Systems Specialist 3Commented:
VBA is still VB. Outlook blocks anything that can be sent that has is an executable attachment. HTA, Excel macros, etc. There was a virus not that long ago that included MS Word document with an embeded macro that downloaded malware to the client's PC.

For a list of blocked attachment types see https://support.office.com/en-us/article/Blocked-attachments-in-Outlook-434752E1-02D3-4E90-9124-8B81E49A8519
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
Jamie GarrochPowerPoint Consultant & DeveloperCommented:
Interesting link Eric. For two reasons. (a) because none of the Office macro-enabled formats are included and (b) the paragraph below, which stunned me. Why implement a security feature and then educate users on how to work around it?!

Rename the file  
You can rename the file (or request that the sender rename the file) to use an extension that Outlook doesn't block. For example, you can rename file.exe to file.docx. Once the renamed file is sent (or received), save it and rename it with the original extension using the following steps.
0
 
Amitesh SinhaAuthor Commented:
I edited my question title and made attachment in Zip format
0
 
Jamie GarrochPowerPoint Consultant & DeveloperCommented:
Did you click the Attach File button followed by the Embed button when you posted your last comment because I still can't see any file. I have uploaded a PowerPoint file to this comment to show you what it should look like.
Dummy-File.pptx.zip
0
 
Amitesh SinhaAuthor Commented:
Jamie, sorry for missing the attachment last time... now i have attached PDF file... let me know if it works for you..!!
My-Questions.pdf
0
 
Jamie GarrochPowerPoint Consultant & DeveloperCommented:
Try this Amitesh:

' ===============================================================
' PowerPoint VBA Module
' Purpose : Set the specified properties for all text shapes this
'           presentation.
' Author : YOUpresent, http://youpresent.co.uk/
' Answer to ExpertsExchange question 29083269
' https://www.experts-exchange.com/questions/29083269/Working-on-Macros-for-PowerPoint.html
' ===============================================================

Option Explicit

' Custom enumeration for the properties to be set
Public Enum ypProperties
  ypPropertyMargins = 1
  ypPropertyShadow = 2
  ypPropertyBullet = 4
End Enum

' Macro 1 : Presets margins to 0.05" for all textboxes in this presentation
Public Sub SetMargins()
  SetTextboxProperties ypPropertyMargins
End Sub

' Macro 2 : Turns shadow off for all textboxes in this presentation
Public Sub SetShadow()
  SetTextboxProperties ypPropertyShadow
End Sub

' Macro 3 : Presets bullets for all textboxes in this presentation
Public Sub SetBullet()
  SetTextboxProperties ypPropertyBullet
End Sub

' Macro 4 : Combines all three macros above
Public Sub SetAll()
  SetTextboxProperties ypPropertyMargins + ypPropertyShadow + ypPropertyBullet
End Sub

' ===============================================================
' Purpose : Set all specified for all text shapes in a presentation
' Inputs : PropertyList - bitwise list of properties to set
' ===============================================================
Private Sub SetTextboxProperties(PropertyList As ypProperties)
  Dim oSld As Slide
  Dim oShp As Shape
  Dim oGrpItem As Shape
  
  For Each oSld In ActivePresentation.Slides
    For Each oShp In oSld.Shapes
      If oShp.Type = msoGroup Then
        For Each oGrpItem In oShp.GroupItems
          If oGrpItem.HasTextFrame Then SetProperty oGrpItem, PropertyList
        Next
      Else
        If oShp.HasTextFrame Then SetProperty oShp, PropertyList
      End If
    Next
  Next
End Sub

' ===============================================================
' Supporting function for SetTextboxProperties
' Purpose : Sets specified properties for the referenced shape
' Inputs : oShp - PowerPoint shape containing a TextFrame
'          PropertyList - bitwise list of properties to set
' Return : True if successful, False if error
' ===============================================================
Private Function SetProperty(oShp As Shape, PropertyList As ypProperties) As Boolean
  On Error Resume Next
  Select Case oShp.Type
    Case msoTextBox, msoAutoShape
      If (PropertyList And ypPropertyMargins) = ypPropertyMargins Then
        With oShp.TextFrame
          .MarginBottom = 3.6
          .MarginLeft = 3.6
          .MarginRight = 3.6
          .MarginTop = 3.6
        End With
      End If
      If (PropertyList And ypPropertyShadow) = ypPropertyShadow Then
        oShp.Shadow.Visible = msoFalse
      End If
      If (PropertyList And ypPropertyBullet) = ypPropertyBullet Then
        With oShp.TextFrame2.TextRange.ParagraphFormat
          With .Bullet
            .Visible = msoTrue
            .Character = Chr(108)
            .Type = msoBulletUnnumbered
            With .Font
              .Name = "Windings"
              .Size = 0.7 * .Parent.Parent.Parent.Font.Size
              .Fill.ForeColor.RGB = RGB(0, 90, 140)
            End With
          End With
          .IndentLevel = 1
          .FirstLineIndent = -13.68
          .LeftIndent = 13.68
          .HangingPunctuation = msoTrue
        End With
      End If
  End Select
  If Err = 0 Then SetProperty = True
  On Error GoTo 0
End Function

Open in new window

1
 
Amitesh SinhaAuthor Commented:
Thanks Jamie for giving the solutions. macro for Shadow great, it really works, thanks. somehow Bullet and Margin are not working for me. will try to fix at my end.
 
Thanks once again...
0
 
Jamie GarrochPowerPoint Consultant & DeveloperCommented:
I tested on my side and it worked in all 3 cases.,could you share ne slide with an example of content that is not working and I will check so that this question can be closed?
0
All Courses

From novice to tech pro — start learning today.