Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing Notes Database from excel

Status
Not open for further replies.

Chrisio

Technical User
Sep 26, 2002
5
GB
Hi All..... Can any one help. I have the below code to export an email from Notes only it doesnt work as far as I can see It connects ok to my notes DB then bombs out on the line:0-

'Set MSDSView = ConMSDS.GETVIEW("view name")
but I get Run Time error 91. Object variable or With Block Vairable not Set does any one know the correct views I can try in order to crack this problem


Private Sub Integrate_LOTUS()
'Declaring variables
Dim Session As Object
Dim ConMSDS As Variant
Dim ConView As Variant
Dim MSDSView As Variant
Dim MSDSDoc As Variant
Dim Doc As Variant
Dim MSDSItem As Variant
Dim CopyItem As Variant
Dim s As Object, db As Object ', Doc As Object


Set s = CreateObject("Notes.Notessession") 'create notes session
Set ConMSDS = s.GETDATABASE("", "") 'set db to database not yet named
Call ConMSDS.openmail
'all of the above opens the connection to notes.
'this stuff below sets the view of what to open this is what I cant work out _
'Set MSDSView = ConMSDS.GETVIEW("view name") - this line is where im goosed I dont _
know what the view is called
If ConMSDS.ISOPEN = True Then
Set MSDSView = ConMSDS.GETVIEW("")
Set MSDSDoc = MSDSView.GETFIRSTDOCUMENT()
Set MSDSItem = MSDSDoc.CREATERICHTEXTITEM(MSDSView.Name)
CopyItem = MSDSItem.COPYITEMTODOCUMENT("c:\tom.rtf", "dont-know-what-to-put-here")
MsgBox (MSDSItem.Name)
End If
End Sub

Cheers
Chris
 
Thanks for the link...but it only shows how to send Email from VBA which I can do..Does any one know of a way to attach to the server and export emails

Cheers
 
The code provided works with the server database not your local replica.
I just follow your code and i thought that it could helps since i use it all the time.
Good Look.
 
Ooops....Didnt see that example..just looked at the one above. Your right it should do every thing I need

Thanxs
Again.
Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top