A
aww91
Hi,
Trying to import data from Lotus Notes into an Excel spreadsheet. The
problem is that the data is stored in an attachment in Notes.
Successful with getting notesmbeddedobject, but not sure what to do
next with it to create Excel workbook object so that I can access the
data. See below:
Macro in Excel:
Dim Session as Object
Dim db As Object
Dim dc As Object
Dim excelObj As Object
'Dim doc As Object
'Create the session.
Set Session = CreateObject("Notes.NotesSession")
'Create a handle to lotus notes database using the session created
above.
Set db = Session.GetDatabase("[serverName]", "[database filename]")
'Create a handle to the document we need
Set dc = db.AllDocuments
Set doc = dc.GetFirstDocument
While Not (doc Is Nothing)
Set docStatus = doc.getFirstItem("docStatus")
Set docSubject = doc.getFirstItem("Subject")
If docStatus.Text = "Completed" Then
Set excelObj = doc.getAttachment("[attachment filename]") <---
Stuck here!!!
End If
Set doc = dc.GetNextDocument(doc)
Wend
End Sub
Trying to import data from Lotus Notes into an Excel spreadsheet. The
problem is that the data is stored in an attachment in Notes.
Successful with getting notesmbeddedobject, but not sure what to do
next with it to create Excel workbook object so that I can access the
data. See below:
Macro in Excel:
Dim Session as Object
Dim db As Object
Dim dc As Object
Dim excelObj As Object
'Dim doc As Object
'Create the session.
Set Session = CreateObject("Notes.NotesSession")
'Create a handle to lotus notes database using the session created
above.
Set db = Session.GetDatabase("[serverName]", "[database filename]")
'Create a handle to the document we need
Set dc = db.AllDocuments
Set doc = dc.GetFirstDocument
While Not (doc Is Nothing)
Set docStatus = doc.getFirstItem("docStatus")
Set docSubject = doc.getFirstItem("Subject")
If docStatus.Text = "Completed" Then
Set excelObj = doc.getAttachment("[attachment filename]") <---
Stuck here!!!
End If
Set doc = dc.GetNextDocument(doc)
Wend
End Sub