Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 01-26-2015, 04:21 PM
macropod's Avatar
macropod macropod is offline Determining file path for linked image in Word 2007 Windows 7 64bit Determining file path for linked image in Word 2007 Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,525
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Change:
Dim StrPath As String, Resp
to:
Dim StrPath As String, Resp, i As Long, sngX As Single, sngY As Single, bRatio As Boolean, iShp As InlineShape

Below:
.LinkFormat.SourceFullName = StrPath
insert:
Code:
        i = ActiveDocument.Range(0, Selection.Range.Start).ContentControls.Count 
        If i > 0 Then
          With ActiveDocument.ContentControls(i)
            If Selection.Range.InRange(.Range) Then
              If .Type = wdContentControlPicture Then
                With .Range.InlineShapes(1)
                  sngX = .Width
                  sngY = .Height
                  bRatio = .LockAspectRatio
                  .Delete
                End With
                Set iShp = .Range.InlineShapes.AddPicture(StrPath, True, True)
                With iShp
                  .LockAspectRatio = bRatio
                  .Width = sngX
                  If bRatio = True Then
                    If .Height > sngY Then .Height = sngY
                  Else
                    .Height = sngY
                  End If
                End With
              End If
            End If
          End With
        End If
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get image in clip draw by giving path gsrikanth Office 0 03-22-2012 05:03 AM
Determining file path for linked image in Word 2007 File Path for Outlook 2007 pst eliz.bell Outlook 2 10-29-2011 07:04 PM
Determining file path for linked image in Word 2007 Display Full File Path Name of Document in Title bar MS-Word 2010 Carlos06x Word 1 10-12-2011 10:39 AM
Excel File as Linked Object in Word jfitch Word 0 03-18-2010 11:44 AM
Programmatically get File Path for currently opened WORD document franferns Word 1 11-26-2009 12:36 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:45 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