?
Solved

Lotus Notes..."Object Variable not set..." when creating new NotesSession

Posted on 2011-04-20
10
Medium Priority
?
1,675 Views
Last Modified: 2013-12-18
When I run the following code in my vba, I receive the error "438 - Object doesn't support this property or method" at the last line.  When I view the value of "s" after it's set, it says "Object variable or With block variable not set". I see this code all over the internet...why isn't it working for me???

Set s = New NotesSession
Dim docMail As NotesDocument
Dim body As NotesMIMEEntity
Dim stream As NotesStream
Dim db As NotesDatabase
Set db = s.CurrentDatabase
0
Comment
Question by:amfierst
  • 4
  • 4
9 Comments
 
LVL 10

Expert Comment

by:doninja
ID: 35431002
First line should be
Dim s as New NotesSession

No need to set.
0
 

Author Comment

by:amfierst
ID: 35431273
Hi there....I actually tried that first and get the same error.  Could it have something to do with the fact that I'm on Lotus Notes 8.5?
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 2000 total points
ID: 35431600
I assume it has to do with the fact that you use VBA. Did you include the necessary OLB stuff in your project? Probably.

What's missing also is this call:

      s.Initialize ("")

And lastly, what is the current database? In a VBA session, there is no current db, you have to open one explicitly.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Closing Comment

by:amfierst
ID: 35456931
Thanks for the suggestions.  It turns out that the code I was citing is for Lotus script, and doesn't work in vba.  So I did have to open the current database as you specified.  Thanks!
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 35458733
A "B" ? What does it take to deserve an "A"?? With the little code and description you gave I think I could hardly have done better...
0
 

Author Comment

by:amfierst
ID: 35458864
True...good point.  Is it too late to change it?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 35464891
:-) Nope... Just hang on...
0
 

Author Comment

by:amfierst
ID: 35465855
Thanks!
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 35466022
Also thanks!!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…

579 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question