topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 11:46 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: How to add an exception for logo in signature to Outlook VBA  (Read 2376 times)

questorfla

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 570
  • Fighting Slime all the Time
    • View Profile
    • Donate to Member
The following Outlook VBA is used to resize all images pasted to the body of an email by 50% scale.  Works great for copy&paste screenshots that are too large for an email page size.

Unfortunately, it doesn't stop with the body of the email but continues on to shrink the logo.jpg in the email signature.  Is there an easy way to exempt the signature portion of the email or other possible options that would allow the VBA to work as it should on all images other than the one in the signature?

Sub ResizeAllPicsTo50Pct()
    Const wdInlineShapePicture = 3
    Dim olkMsg As Outlook.MailItem, wrdDoc As Object, wrdShp As Object
    Set olkMsg = Application.ActiveInspector.CurrentItem
    Set wrdDoc = olkMsg.GetInspector.WordEditor
    For Each wrdShp In wrdDoc.InlineShapes
        If wrdShp.Type = wdInlineShapePicture Then
            wrdShp.ScaleHeight = 50
            wrdShp.ScaleWidth = 50
        End If
    Next
    Set olkMsg = Nothing
    Set wrdDoc = Nothing
    Set wrdShp = Nothing
End Sub