Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2005

Tip: Looking for answers? Try searching our database.

VBA code to display properties of linked OLE objects

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
L Mehl - 04 Oct 2005 05:54 GMT
Hello --

I have many objects in a doc which I have linked using

Insert | Picture | From File: Link to File

I want to confirm that I have linked them correctly.

Does anyone know of VBA code to find these objects in a doc and list
selected properties of them?

Thanks for any help.

Larry Mehl
macropod - 04 Oct 2005 09:07 GMT
Hi Larry,

If you press Alt-F9, Word will toggle the field code view on/off. You can
use that, without any code, to examine the links.

Other than that, try:

Sub ListFields()
Dim oFld As Field
If ActiveDocument.Fields.Count > 0 Then
   For Each oFld In ActiveDocument.Fields
       With Selection
           .EndKey Unit:=wdStory
           .InsertAfter vbCrLf
           .EndKey Unit:=wdStory
           .TypeText Text:="{" & oFld.Code & "}, " & oFld.Result
       End With
   Next oFld
End If
End Sub

This will report all field codes and their results at the end of you
document.

Cheers

> Hello --
>
[quoted text clipped - 10 lines]
>
> Larry Mehl
L Mehl - 04 Oct 2005 17:22 GMT
Hi Macropod --

Thank you for the code.

Larry

> Hi Larry,
>
[quoted text clipped - 36 lines]
> >
> > Larry Mehl
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.