Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Apparently using Word 2010 64 bit won't allow pdfs to be embedded, 32 bit will. So, to use 64 bit I have a macro:
VB
Sub PDF()
  Selection.InlineShapes.AddOLEObject ClassType:="AcroExch.Document.7, _
  FileName:="", LinkToFile:=False, DisplayAsIcon:=True, _
  IconFileName:="C:\WINDOWS\Installer\{AC76BA86-7AD7-1033-7B44-AA1000000001}\PDFFile_8.ico" _
  , IconIndex:=0, IconLabel:=""
End Sub

How do I get the file name of the file that is selected to embed to be the IconLabel?
Browsing for the file, embedding and displaying the PDF icon is fine.

Thanks
Posted
Updated 27-Jul-12 9:25am
v2
Comments
Kenneth Haugland 27-Jul-12 15:37pm    
Did you try and do this in a word document with record macro?
Member 8105842 27-Jul-12 15:54pm    
No, I wrote the macro. Upon execution it will open a window to browse to select a file, embed the file and use the acrobat icon. I just need it to add the filename of the file that was selected and embedded.

1 solution

Seems to be a known problem:
http://forums.adobe.com/thread/758213[^]
 
Share this answer
 
Comments
Member 8105842 27-Jul-12 22:02pm    
Yes, I researched the problem before I wrote the macro. I just need to be able to get the file name into IconLabel. My company is using Office 2010 64 bit and reader 10.1. That won't change. So, until MS or adobe patches either, I'll have to use a macro.
Kenneth Haugland 27-Jul-12 22:36pm    
I dont really understand your question, cant you just send the string in the macro call like the example here:
http://support.microsoft.com/kb/306683 ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900