Page 1 of 2 12 LastLast
  1.    21 Mar 2017 #1
    Join Date : Nov 2015
    Posts : 108
    Win 10

    Changing size of images pasted to email body in Outlook 2016


    This is a something that was always a nagging problem but got worse when I found a solution as it only worked for about 2 times then quit.
    I have to use a screen capture utility (currently Lightscreen) to capture specific images on my screen and when I paste the results of the capture into the body of an email it is always too large by exactly double. This is regardless of the size of the screen area captured.
    After pasting, I have to select the image click on picture settings and reduce the size by 50% on every one of them to get things to the proper perspective when emailed. This takes several clicks to do and in searching i found others with the same issue. I also found one person that posted a 'fix' using a custom VBA for Outlook.
    The VBA was originally written to reduce by 75% but it worked perfect at 50% as well. One click of the macro would reduce all images in the email to 50% scale regardless of how many were there. Perfect! It worked for about 3 times, Just enough for me to be pleased i had a solution...Then suddenly it didn't.
    It no longer works on the system it started on nor will it work on another system i tried it on. At this point I am beginning to suspect something to do with VBA in Outlook 2016. I even created a self-signed cert for it and signed the VBA module but at this point, even if i remove everything and try starting from scratch, i cannot get it to work again.
    Below is the exported .bas file from Outlook if anything sticks out.
    Or if anyone can suggest another way to achieve the same results? This is used to send screenshots of specific situations to people by email so it is almost always the same steps. I might find the answer in a different screen-capture utility but at this point I sure wish I knew why the VBA stopped working regardless.
    Below is the code for the Macro to reduce by images 50%. This macro is then added to the QAT bar.

    Code:
    Attribute VB_Name = "Module1"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 = NothingEnd Sub
      My ComputerSystem Spec
  2.    21 Mar 2017 #2
    Join Date : Jan 2014
    Posts : 1,391
    Windows 10 Pro (32-bit) 16299.15

    What happens when you run the VBA? Is there an error message or similar?
    Given the context... perhaps you could post a screenshot. (Ideally NOT reduced to 50%!)

    I tried it quickly in Outlook 2016 and it seems to work for me.
      My ComputerSystem Spec
  3.    21 Mar 2017 #3
    Join Date : Nov 2015
    Posts : 108
    Win 10
    Thread Starter

    Quote Originally Posted by DavidY View Post
    What happens when you run the VBA? Is there an error message or similar?
    Given the context... perhaps you could post a screenshot. (Ideally NOT reduced to 50%!)

    I tried it quickly in Outlook 2016 and it seems to work for me.
    I agree I did for me as well. Did you use a self signed certificate? Or just disable Macro checks or? On further reading of the original post i found others who also had problems. Some reported back that it started working again but failed to say if they had done anything do fix it. At this point, i am just relieved to know someone else has it working as it is a perfect solution for my needs.
    if you have manged to close Outlook and then reopen it and find it still working then i have to assume it is something about my copy of Outlook, maybe a different add-in or other program.
    PS: I am not at the office where the original systems is but i can load it here and try it on this one and if I get results will post them
    There are no errors, it just doesn't do anything all when selected. If i posted an image it might or might nort need reduction, Most of the ones that do are if pasted in to WORD or OUTLOOK and it is pretty obvious that they are larger than they are in real-life is the reason for the needed reduction.
      My ComputerSystem Spec
  4.    21 Mar 2017 #4
    Join Date : Jan 2014
    Posts : 1,391
    Windows 10 Pro (32-bit) 16299.15

    Quote Originally Posted by questorfla View Post
    I agree I did for me as well. Did you use a self signed certificate? Or just disable Macro checks or? On further reading of the original post i found others who also had problems. Some reported back that it started working again but failed to say if they had done anything do fix it. At this point, i am just relieved to know someone else has it working as it is a perfect solution for my needs.
    if you have manged to close Outlook and then reopen it and find it still working then i have to assume it is something about my copy of Outlook, maybe a different add-in or other program
    I just opened Outlook and pasted in the code from your post (with some Carriage Returns to keep VBA happy) and tried it on a test email. I didn't change any settings, I think (can't remember what I did when setting up the laptop but pretty sure I've not changed much). I don't even know how to make a self-signed certificate I'm afraid.
    It's possible I'm not running the latest Outlook 2016 though.

    What happens when you try it?

    Edit: saw your PS. I'd probably open the VBA editor, ideally position Windows so you can see both the VBA Editor and the email window, and run the macro in 'Step Into' mode to see what happens step-by-step. Might give you a clue.
      My ComputerSystem Spec
  5.    21 Mar 2017 #5
    Join Date : Nov 2015
    Posts : 108
    Win 10
    Thread Starter

    Quote Originally Posted by DavidY View Post
    I just opened Outlook and pasted in the code from your post (with some Carriage Returns to keep VBA happy) and tried it on a test email. I didn't change any settings, I think (can't remember what I did when setting up the laptop but pretty sure I've not changed much). I don't even know how to make a self-signed certificate I'm afraid.
    It's possible I'm not running the latest Outlook 2016 though.?
    Give me a few secs to load it here. the self signed signature thing uses an app in outlook located at C:\Program Files (x86)\Microsoft Office\root\Office16 named "selfcert.exe". you can run that to create your own personal signing certificate using any name you want.
    Then you can use this to sign VBA's or other modules as needed.
    In the Click image for larger version. 

Name:	2017_03_21_23_32_551.png 
Views:	11 
Size:	20.9 KB 
ID:	126116

    this is what happens copy paste direct into the panel here >> Looks Pretty small.
    This is where you set the Macro Security option in Trust Center Looks small now i will see what happens when i click post.
    The answer is it enlarges perfectly so you can see what I mean
      My ComputerSystem Spec
  6.    21 Mar 2017 #6
    Join Date : Nov 2015
    Posts : 108
    Win 10
    Thread Starter

    I see what you mean about adding line feeds it didn't look that way when i posted it Sorry
      My ComputerSystem Spec
  7.    21 Mar 2017 #7
    Join Date : Nov 2015
    Posts : 108
    Win 10
    Thread Starter

    so far so good. Created macro, added to QAT. open new email added pic from clipboard, clicked button in QAT and it worked as advertised. On this system i have Macros enabled fully have not done any self signing etc. Just keeping track. I have also not restarted outlook to see if it saves the macro as enabled
    here is the correct coding for anyne else if they should want it with the line feeds intact

    "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
    "
    I give up i pasted it direct from notepad inside the code block and it removed line feeds again so here is text.

    OK i marked it solved because i guess the problem is local to those systems.
    i did the close and reopen on outlook On closing it asked if i wanted to save the maacro. I said "Yes" as before.
    On reopening Outlook the Macro option is stil in QAT and works properly. I may need to investigate the systems it failed on because it works fine here. Thanks much for your input giving me enough Hope to try it again here.

    the obvious settings of 50 in height and width are where anyone else wanting this can change it as needed to whatever percent of scale they might need.
      My ComputerSystem Spec
  8.    21 Mar 2017 #8
    Join Date : Jan 2014
    Posts : 1,391
    Windows 10 Pro (32-bit) 16299.15

    Once I tried saving the macro, closing and re-opening Outlook, it fails for me too!
    It isn't behaving as it should, because even when I set the Macro security to Notify me, it just does nothing, when it should pop up a dialog or similar.
      My ComputerSystem Spec
  9.    21 Mar 2017 #9
    Join Date : Nov 2015
    Posts : 108
    Win 10
    Thread Starter

    I just realized that if i mark it solved so one else can contribute so i changed it back to unsolved in case of other replies and in case i learn further of the reasons. In the various comments above where it may sound confusing: to clarify
    If i paste an image into my post while writing it is extremely small but as soon as I click Post. the image shows at full size on the Board.
    Also: when pasting into the CODE tags I don't know why the line feeds are dropped but it also dropped them the 2nd time so I added to statements inside regular quotes as text,
    Finally, once the Macro is created, it cn easily be added to the Ribbon by selecting Customize the Ribbon with right click and choosing Macros from the list as shown here:
    Click image for larger version. 

Name:	2017_03_22_00_12_121.png 
Views:	9 
Size:	12.8 KB 
ID:	126121 Again, this shows as very tiny while writing this but shows as full size once i click Post Quick Reply
      My ComputerSystem Spec
  10.    21 Mar 2017 #10
    Join Date : Nov 2015
    Posts : 108
    Win 10
    Thread Starter

    Added info. The normal ALT+F8 keyboard press brings up the list of macros to run box and allows a keyboard shortcut access. What I would now like to find is the way to make a dedicated keyboard shortcut to RUN the command when pressed.

    DavidY: on the problem: Once I tried saving the macro, closing and re-opening Outlook, it fails for me too!

    I am pretty sure that if you go to the setting under File>Options>Trust Center> Trust Center Settings

    Click image for larger version. 

Name:	2017_03_22_00_39_541.png 
Views:	1 
Size:	28.4 KB 
ID:	126135
    to get the image I first posted above. In that area under Macro Settings choose enable for ALL (at least as a test).
    Click OK and back all the way out then close Outlook.
    On the exit from Outlook be sure to Save the Macro when it asks.

    Finally, it probably wouldn't hurt to sign out of Windows then back in (faster than rebooting) so you can be 100% sure nothing was held over. I have done all of this trying my best to get it to Fail now .. So far.. So good!

    That is pretty much where I am now and after several restarts I am comfortable that the Macro is staying on-board and working.

    PPS: see this link This is where i ended up on the other systems looing for a reason for the same behavior you got. Same issues. No errors no verbiage as to what is wrong.

    https://social.msdn.microsoft.com/Fo...rum=outlookdev
      My ComputerSystem Spec

 
Page 1 of 2 12 LastLast


Similar Threads
Thread Forum
how do I change font size/style in folder pane of outlook 2016
so, I have been searching for days, and cant find a solution that actually works In outlook 2016, in the folder pane, I want to change the font..not the message pane, or the preview pane, but in the far left pane where all my folders reside. In...
Browsers and Email
Outlook 2016 - Exchange Server and POP3 email accounts
I use Outlook 2016 for all my email requirements. One BTinternet.com email address One Outlook.com email address Previously had above two email accounts sending and receiving from the same PST file each using POP3. Wanted to change the...
Browsers and Email
automatically add two carriage returns to all pasted text or images
It seems there used to be a windows interface for the clipbrd.exe utility but if there is one in Windows 10 I cannot find it. I am trying to add 2 <cr> (line break) or <Enter> characters to the end of anything I put in the clipboard before it gets...
General Support
Changing the default Font Size in my Email
Hi While I used to send emails from Yahoo, it doesn't seem to work with Windows 10, as I have to type Soooo Slowly or Win 10 can't keep up. Anything more than one digit (letter) every two Seconds and it just hangs. So now I've started using...
Browsers and Email
Solved Cannot make Outlook 2016 Default Email
I cannot make Outlook 2016 default email client. I try tru the setting...default and it looks like it is the default. Then I get an error window that says there is no email default and I should set it up in Outlook 2016. When I try it takes me back...
Software and Apps
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 06:55.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums