Extract File From OLE Object

I have a form which has an embedded OLE MS Word Document on it, which will be edited and then approved. When approved, I want to be able to display the form on the web, and have users be able to view/open the Word Document.

I cannot see any direct method of displaying the embedded ole word document online and so thought at the approval process I could extract the file from the OLE object and attach it to a rich text field which could then be accessed on the web, however, the ExtractFile method does not work with OLE objects.

Is there any other way I can have the OLE word doc displayed on the web? I only want read, not edit access

Thanks

Subject: Extract File From OLE Object

hi David Inglis,i have issue that i can’t extract the file from OLE object. So could you send me the code to implement this.

Thanks

Subject: Extract File From OLE Object

I used this code to extract an embedded object and save it to the user’s “My Documents” directory:

Sub Click(Source As Button)

Dim uidoc As notesuidocument

Dim doc As notesdocument

Dim EmbedObj As NotesEmbeddedObject

Dim handle As Variant

Dim MyDocumentsPath As Variant

Set w = New NotesUIWorkspace

Set uidoc = w.currentdocument

Set doc = uidoc.document

Set EmbedObj = doc.EmbeddedObjects(0)

Set handle = uidoc.GetObject(EmbedObj.Name)

Call EmbedObj.Activate(False)

MyDocumentsPath = Evaluate( “@RegQueryValue( ““HKEY_CURRENT_USER”” ;”“Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders”“; ““Personal”” )”, doc )

If Left(EmbedObj.class, 11)=“Excel.Sheet” Then

'We are saving an excel spreadsheet.

Answer = Messagebox ( “Do you want to save this document to your computer’s hard drive?”, 4+32+0+0, “File Save”)

If Answer = 6 Then

'User clicked the “Yes” button.

Answer = “”

Answer = Inputbox(“Enter the filename you want to save the document as.”, “File Save”) + “.xls”

If Answer = “.xls” Then

'User didn’t enter a filename.

Messagebox “Document not saved.”

Exit Sub

End If

Call handle.SaveAs (MyDocumentsPath(0) + "" + Answer)

Messagebox “Document saved to your folder My Documents.”

Else

'User clicked the “No” button.

Messagebox “Document not saved.”

End If

Elseif Left(EmbedObj.class, 13)=“Word.Document” Then

'We are saving a Microsoft Word document.

Answer = Messagebox ( “Do you want to save this document to your computer’s hard drive?”, 4+32+0+0, “File Save”)

If Answer = 6 Then

'User clicked the “Yes” button.

Answer = “”

Answer = Inputbox(“Enter the filename you want to save the document as.”, “File Save”) + “.doc”

If Answer = “.doc” Then

'User didn’t enter a filename.

Messagebox “Document not saved.”

Exit Sub

End If

Call handle.SaveAs (MyDocumentsPath(0) + "" + Answer)

Messagebox “Document saved to your folder My Documents.”

Else

'User clicked the “No” button.

Messagebox “Document not saved.”

End If

Elseif Left(EmbedObj.class, 15) = “PowerPoint.Show” Then

'We are saving a Powerpoint presentation.

Answer = Messagebox ( “Do you want to save this document to your computer’s hard drive?”, 4+32+0+0, “File Save”)

If Answer = 6 Then

'User clicked the “Yes” button.

Answer = “”

Answer = Inputbox(“Enter the filename you want to save the document as.”, “File Save”) + “.ppt”

If Answer = “.ppt” Then

'User didn’t enter a filename.

Messagebox “Document not saved.”

Exit Sub

End If

'Call EmbedObj.Object.SaveAs (Answer)

Call handle.SaveAs (MyDocumentsPath(0) + "" + Answer)

'Call EmbedObj.Object.Application.Quit

Messagebox “Document saved to your folder My Documents.”

Else

'User clicked the “No” button.

Messagebox “Document not saved.”

End If

End If

End Sub

Subject: RE: Extract File From OLE Object

For extracting embedded (OLE) object from mail the above code was really very helpful. It is perfectly working for Word and Powerpoint documents but if i am trying extracting Excel object from mail it is extracting the excel object but its not opening in Excel application. But when i try to open using Internet explorer it is opening. Any suggestions. I am using Lotus Notes 6.5 and Microsoft Excel 2002 sp2.

Any help on this is highly appreciated.

Subject: Extract File From OLE Object

Look at the documentation for the NotesDocument class. Specifically, the EmbeddedObjects property.

Subject: RE: Extract File From OLE Object

I have. So unless I’m missing something, I wouldn’t mind some help

The help topic you specify does indeed tell me how to get a handle on the object, but I still do not know how to then display that on the web, whether it be as an attachment or otherwise.

I do not see any methods listed which will allow me to do so, which is why I am asking for help