-
A little closer now
[VBA]
Sub AddMyObject()
Selection.InlineShapes.AddOLEObject ClassType:="WordPad.Document.1", _
FileName:="", LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:\Program Files\Windows NT\Accessories\WORDPAD.EXE", IconIndex:=1, _
IconLabel:="Add name here"
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Font.Hidden = True
End Sub
Sub RetrieveTest()
Dim i As Integer, j As Integer
j = ActiveDocument.InlineShapes.Count
For i = 1 To j
If ActiveDocument.InlineShapes(i).OLEFormat.IconLabel = "The one I want" Then
ActiveDocument.InlineShapes(i).OLEFormat.DoVerb wdOLEVerbOpen
End If
Next i
End Sub
[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules