Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-04-2017, 01:27 AM
FionaMcKenzie FionaMcKenzie is offline Hyperlink to image in folder Windows 10 Hyperlink to image in folder Office 2016
Novice
 
Join Date: Oct 2017
Location: Surrey, United Kingdom
Posts: 14
FionaMcKenzie is on a distinguished road
Default

Hi there,

I hope I have understood your question? Does the following code do what you want?

Option Explicit

Public Sub HyperlinkedPicture()

Dim oInlineShape As Word.InlineShape
Dim sFileFullName As String
Dim oFileBrowse As FileDialog

Set oFileBrowse = Application.FileDialog(msoFileDialogFilePicker)

With oFileBrowse


.Title = "Insert Picture"
.AllowMultiSelect = False
.ButtonName = "Insert and Hyperlink"
.Filters.Clear
.Filters.Add "Pictures", "*.jpg, *.jpeg, *.wmf, *.emf, *.gif"
If .Show Then

sFileFullName = .SelectedItems(1)

Set oInlineShape = Selection.InlineShapes.AddPicture _
(FileName:=sFileFullName, LinkToFile:=True, SaveWithDocument:=False)

ActiveDocument.Hyperlinks.Add Anchor:=oInlineShape.Range, _
Address:=sFileFullName

End If

End With

Set oInlineShape = Nothing
Set oFileBrowse = Nothing

End Sub
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlink to image in folder Hyperlink Text to an Image in Word Franklin Drawing and Graphics 8 09-19-2015 02:14 PM
How do I add a hyperlink to an image? sarahrb PowerPoint 1 08-26-2012 08:26 AM
Hyperlink to image in folder Putting an image with hyperlink to certain slides spiffmonkey1 PowerPoint 1 07-17-2011 03:58 PM
Hyperlink to image in folder Adding Image into a excel cell and adding a hyperlink to the image saravananiyyanar Excel 3 05-04-2011 08:31 AM
Outlook and folder hyperlink RalphConnor Outlook 0 02-28-2011 12:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:58 AM.


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