insert object as Adobe icon

February 22, 2009 at 05:32:38
Specs: Windows Vista
Hello, I am trying to add several pdf files from clipboard copied in a Windows Explorer into a Microsoft Word 2002/2003 document so that they are shown as icons straightaway. At this stage they are inserted with the first page shown and one has to right-click select Acrobat Document Object->Convert...->tick Show Icon box. What can I do if I want to set it by default?

Many thanks!

See More: insert object as Adobe icon

Report •

February 23, 2009 at 06:47:30
Why not insert the object using the Create From File tab with the Link to File and Display as Icon options selected?

Report •

February 28, 2009 at 00:47:52

Hello, many thanks for your suggestion, however, the paste operation will be done by other people than me and for them it could be very complicated. I need a simple copy and paste workaround so that it can be displayed in the document as a clickable icon.

Unfortunately, the problem I am facing is not as easy as that and I got stuck.

Would anybody have any idea how to manage to solve the issue?

Many thanks

Report •

February 28, 2009 at 10:49:17
I managed to record this code while doing the Paste/Convert operations. It works once, but it doesn't always Select the most recently pasted in object, so sometimes it fails.

I'm not that strong with VBA for Word, so I'm not sure how to always select the item that is currently on the clipboard and Paste/Convert it.

The goal would be to have the user Copy the PDF and then click a button to Paste/Convert it in one operation.

I'll keep playing, but if you know how to fix this code, you might have your solution.

Sub ConvertToIcon()
    Application.WindowState = wdWindowStateNormal
    ActiveDocument.Shapes("Object 2").Select
    If Selection.Type <> wdSelectionShape Then
    End If
    Selection.ShapeRange(1).OLEFormat.ConvertTo ClassType:= _
        "AcroExch.Document.7", DisplayAsIcon:=True, IconFileName:= _
        "C:\WINDOWS\Installer\{AC76BA86-7AD7-1033-7B44-A90000000001}\PDFFile_8.ico" _
        , IconIndex:=0, IconLabel:="Acrobat Document"
End Sub

P.S, I suggest you record your own code since it looks like the Windows/Installer info may be specific to my machine.

Report •

Related Solutions

March 7, 2009 at 12:27:20

Thank you! Absolutely perfect. I'll try to fiddle around with the code and hopefully the solution will come up. I know very little about scripting but I do have a programming knowledge so after some experiments a chance to move on might be at sight. Excellent! Once again many thanks.

Report •

Ask Question