Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-26-2023, 04:33 AM
ChrisGreaves ChrisGreaves is offline Word Fields and Relative Paths to External Files - IncludePicture field problems Windows 10 Word Fields and Relative Paths to External Files - IncludePicture field problems Office 97-2003
Novice
Word Fields and Relative Paths to External Files - IncludePicture field problems
 
Join Date: Nov 2022
Location: Bonavista, Newfoundland
Posts: 22
ChrisGreaves is on a distinguished road
Default Word Fields and Relative Paths to External Files - IncludePicture field problems

I am trying to implement a technique proposed by Macropod in the topic Word Fields and Relative Paths to External Files.
I can see the result of the {Filename \P} and have tried both the "/../" and the "\\.." methods. As far as I can see both methods work for the end-user (me!) until i try yo access the {IncludePicture} field in VBA.


Four macros provide access to images, here is one:-
Code:
Sub ShowImageToUser()
        Dim fld As Field
    If Selection.Fields.Count = 0 Then
'        MsgBox "EditImage - You need to select an IncludePicture field!"
        Set fld = ActiveDocument.Fields(1)
    Else
        Set fld = Selection.Fields(1)
    End If
        Dim strFullname As String
        strFullname = fld.Code.Text
        Call UW.strsplitat(strFullname, """")
        strFullname = UW.strsplitat(strFullname, """")
        ActiveDocument.FollowHyperlink Address:="file:" & strFullname
 End Sub




My macro fails on the last line, and the debug window shows this (attached image)


Thanks for any help
Chris




Attached Images
File Type: png ShowImageToUser.png (27.8 KB, 24 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
INCLUDEPICTURE for external URLs has stopped working in new Windows word versions (pixel tracking) mrgoos Word 8 09-24-2021 01:09 PM
@Macropod Macro VBA LINK Fields Relative Paste Special as Image from Excel word bug ggll Word 0 09-18-2021 11:48 PM
Word Fields and Relative Paths to External Files - IncludePicture field problems Word Fields and Relative Paths to External Files macropod Word 0 04-08-2018 05:06 PM
Word Fields and Relative Paths to External Files - IncludePicture field problems Copy IncludePicture field code VEA Word 1 06-21-2016 07:01 PM
Has the problem with relative paths been resolved in Word 2010? Aston Word 1 10-24-2012 11:38 PM

Other Forums: Access Forums

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