Linked files collection in Word Object

N

Neil Dittmar

Hello all,

I need to determine what files have been linked to a
particular document using the Word Object Model. I assume
that the filenames are stored in some type of collection
in the object (as table are, etc.) I can't seem to find
the name of the collection so if anyone can post this, it
would be greatly appreciated.

I'd need a solution for both Word 2000, XP, and 2003
versions. I will be accessing the Word Object Model via
Visual Basic 6.

Thanks in advance,

Neil Dittmar
Software Developer
Aurora Information Systems
 
W

Word Heretic

G'day "Neil Dittmar" <[email protected]>,

Depends on how they are linked and the source content type. They are
either Fields (of specific types) or Shapes.

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


Neil Dittmar reckoned:
 
D

Duane Hookom

Neil,

I recently wanted to update a bunch of links in some Word documents and used
code similar to:

Sub FindLinks()
Dim lnk As Word.Field
Dim strLinkFile As String
On Error Resume Next
For Each lnk In ThisDocument.Fields
'check the link type
If lnk.Type = wdFieldIncludeText Then
'update the link with the new file location
strLinkFile = Replace(lnk.Code, "T:\\ABC1Depts",
"\\\\usABCw00\\shares\\depts")
lnk.Code.Text = strLinkFile
End If
Next
End Sub

HTH, I don't hang around this NG much, only when looking for an answer
rather than attempting to provide one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top