Generating a list of objects or text that are linked to my documen

D

David

How can I generate a detailed list of objects, or text, that are linked to my
document?
 
D

Doug Robbins - Word MVP

The following should create a new document containing the details of each
linked object in the document that is the active document when the code is
run:

Dim alink As Field
Dim Source As Document
Dim Target As Document
Set Source = ActiveDocument
Set Target = Documents.Add
Target.Range.InsertAfter "The following links are present in " & Source.Name
& ":" & vbCr
With Source
For Each alink In .Fields
If alink.Type = wdFieldLink Then
Target.Range.InsertAfter alink.Code.Text & vbCr
End If
Next alink
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

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