(Note: I'm a VBA newbie...be kind
I have a spreadsheet with some embedded PDF files. The files are attached with the following code:
NumDocs = InputBox("How Many **Documentation** files do you wish to attach?"
Dim DocPath As String
i = 0
MsgBox "Select the .PDF file you wish to attach as your Documentation."
Do Until NumDocs = 0
thefile = Application.GetOpenFilename("PDF Files, *.pdf"
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
Loop
I'd like to write some code to grab the filenames of these embedded files, as a precursor step to uploading then into an Oracle db (via Oracle SQL loader). However, I have been only able to get the OLEObject Name in the format of "Object XX":
j = 2
For Each obj In Worksheets("Attachments".OLEObjects
If obj.OLEType = 1 Then ' don't show command buttons
MsgBox "OLEOject name: " & obj.Name
End If
j = j + 1
Next
If I right-click the embedded file, then select "Package Object", "Edit Package" I can see the orignal file's name. This is the "name" I need...
Any suggestions?
Many Thanks,
Greg
I have a spreadsheet with some embedded PDF files. The files are attached with the following code:
NumDocs = InputBox("How Many **Documentation** files do you wish to attach?"
Dim DocPath As String
i = 0
MsgBox "Select the .PDF file you wish to attach as your Documentation."
Do Until NumDocs = 0
thefile = Application.GetOpenFilename("PDF Files, *.pdf"
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
Loop
I'd like to write some code to grab the filenames of these embedded files, as a precursor step to uploading then into an Oracle db (via Oracle SQL loader). However, I have been only able to get the OLEObject Name in the format of "Object XX":
j = 2
For Each obj In Worksheets("Attachments".OLEObjects
If obj.OLEType = 1 Then ' don't show command buttons
MsgBox "OLEOject name: " & obj.Name
End If
j = j + 1
Next
If I right-click the embedded file, then select "Package Object", "Edit Package" I can see the orignal file's name. This is the "name" I need...
Any suggestions?
Many Thanks,
Greg