Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 05-20-2018, 12:38 AM
gmayor's Avatar
gmayor gmayor is offline Anyway to insert thumbnail opening to a larger picture Windows 10 Anyway to insert thumbnail opening to a larger picture Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The following macro will insert a linked thumbnail image at the cursor, subject to the provisos mentioned by Andrew. Call it from a macro that provides the image path and optionally the screen tip text.



Code:
Sub InsThumbNail(strPath As String, _
                 Optional strTipText As String = "Link to full size image")
'Graham Mayor - http://www.gmayor.com - Last updated - 20 May 2018
Dim oShape As InlineShape
    Set oShape = Selection.InlineShapes.AddPicture(FileName:=strPath, _
                                                   LinkToFile:=False, _
                                                   SaveWithDocument:=True)
    With oShape
        .LockAspectRatio = msoTrue
        .Width = InchesToPoints(1)
        ActiveDocument.Hyperlinks.Add Anchor:=.Range, _
                                      Address:=strPath, _
                                      SubAddress:="", _
                                      ScreenTip:=strTipText, _
                                      TextToDisplay:=.Range.Text
    End With
lbl_Exit:
    Set oShape = Nothing
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyway to insert thumbnail opening to a larger picture Picture content control -> insert picture -> empty? Jaymond Flurrie Word 3 07-13-2016 07:00 AM
Anyway to insert thumbnail opening to a larger picture How do I insert pictures directly into picture boxes by clicking the box instead of using INSERT>PIC Bree Word 1 06-24-2016 10:32 PM
Anyway to insert thumbnail opening to a larger picture Error message opening a document in Word "Word cannot open this file because it is larger than 512 M poonamshedge Word 2 09-11-2014 06:11 AM
Anyway to insert thumbnail opening to a larger picture "Insert Picture\Link to File..." embeds picture sinz54 Drawing and Graphics 1 09-29-2013 06:31 PM
Can i insert a thumbnail image, but expand it during my presentation? deejaycruiser PowerPoint 1 11-10-2010 11:13 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft