Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to comp.groupware.lotus-notes.programmer,microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel VBA - Working with Lotus Notes notesembeddedobjects

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Excel VBA - Working with Lotus Notes notesembeddedobjects

I don't have Lotus Notes, but is there an option/method to save the
attachment and then you could just open it in Excel.

--
Regards,
Tom Ogilvy


"aww91" wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel VBA - Working with Lotus Notes notesembeddedobjects

Thanks for your prompt reply. Yes, in Lotus Notes you can use the
ExtractFile method to save the attachment and then re-open it.
Solution is a little inefficient and I wanted to avoid it if at all
possible - but I may not have a choice.

Thanks again,

  #4   Report Post  
Posted to comp.groupware.lotus-notes.programmer,microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Excel VBA - Working with Lotus Notes notesembeddedobjects

No idea about Lotus Notes, but do you have to use late binding ?
If you can set a reference in Excel, then you do not have to use the generic
"Object" variable, but can use those exposed by the library.
You will also get Intellisense to help you with the available methods,
properties etc.
Also the Object browser will list those available.

NickHK

"aww91" wrote in message
ups.com...
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



  #5   Report Post  
Posted to comp.groupware.lotus-notes.programmer,microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA - Working with Lotus Notes notesembeddedobjects

Maybe you have to save the attachment first, before you can open it?
like

if excelOBJ.type = 1454 then
call excelObj.ExtractFile(filepath)
end if

EMBED_ATTACHMENT = 1454
And afterwards you could load the Workbook like any normal xls file.

getAttachement returns a NotesEmbeddedObject Object, I don't think it
can directly be opened in Excel.

If docStatus.Text = "Completed" Then
Set excelObj = doc.getAttachment("[attachment filename]") <---
Stuck here!!!



NickHK schrieb:
No idea about Lotus Notes, but do you have to use late binding ?
If you can set a reference in Excel, then you do not have to use the generic
"Object" variable, but can use those exposed by the library.
You will also get Intellisense to help you with the available methods,
properties etc.
Also the Object browser will list those available.

NickHK

"aww91" wrote in message
ups.com...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lotus Notes doc link not working in Excel Yogi Smith Excel Programming 0 July 11th 06 06:22 PM
Lotus Notes Doc link in Excel?? Yogi Smith Excel Programming 0 July 10th 06 04:59 AM
Lotus Notes Doc LINK in Excel??? Yogi Smith Excel Discussion (Misc queries) 0 July 10th 06 04:24 AM
Excel/Lotus Notes StephanieH Excel Programming 2 December 9th 04 08:11 AM
Emailing Lotus Notes From Excel Charles Excel Programming 0 February 12th 04 03:24 PM


All times are GMT +1. The time now is 07:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"