Hello,
I need a bit of help extracting a copy of an embedded OLEObject file from a sheet and saving it to a local directory. Here's the snippet of code to originally embed the PDF file:
Sub AttachDocumentation()
NumDocs = InputBox("How Many **Documentation** files do you wish to attach?"
Dim DocPath As String
i = 0
j = 4
MsgBox "Select the .PDF file you wish to attach as your Documentation."
ActiveSheet.Range("A3"
.Value = "Documentation Name"
Do Until NumDocs = 0
thefile = Application.GetOpenFilename("PDF Files, *.pdf"
ActiveSheet.Cells(j, 1) = "Documentation" & i & " is: " & thefile
ActiveSheet.OLEObjects.Add(Filename:= _
thefile, Link:= _
False, DisplayAsIcon:=True, IconFileName:= _
"C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe", IconIndex:=0, _
IconLabel:= _
"Documentation" & i).Select
NumDocs = NumDocs - 1
i = i + 1
j = j + 1
Loop
End Sub
What method should I use to extract the file to a local directory for use with other operations? SaveToOle1File Method? I can't seem to find any example code anywhere. I'd like to preserve the original filename - not the the icon label.
Thanks in advance,
NatureBoy
I need a bit of help extracting a copy of an embedded OLEObject file from a sheet and saving it to a local directory. Here's the snippet of code to originally embed the PDF file:
Sub AttachDocumentation()
NumDocs = InputBox("How Many **Documentation** files do you wish to attach?"
Dim DocPath As String
i = 0
j = 4
MsgBox "Select the .PDF file you wish to attach as your Documentation."
ActiveSheet.Range("A3"
Do Until NumDocs = 0
thefile = Application.GetOpenFilename("PDF Files, *.pdf"
ActiveSheet.Cells(j, 1) = "Documentation" & i & " is: " & thefile
ActiveSheet.OLEObjects.Add(Filename:= _
thefile, Link:= _
False, DisplayAsIcon:=True, IconFileName:= _
"C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe", IconIndex:=0, _
IconLabel:= _
"Documentation" & i).Select
NumDocs = NumDocs - 1
i = i + 1
j = j + 1
Loop
End Sub
What method should I use to extract the file to a local directory for use with other operations? SaveToOle1File Method? I can't seem to find any example code anywhere. I'd like to preserve the original filename - not the the icon label.
Thanks in advance,
NatureBoy