?
Solved

Error:  Variant does not contain an object

Posted on 2004-08-04
6
Medium Priority
?
4,516 Views
Last Modified: 2013-12-18
Hi

I am getting a Variant does not contain an object error
I am prett sure it has to do with the emaildoc declaration

HHMMmm
Sub SendCORP
      On Error Goto AnyOtherErrors
      Print "SendingNotification"
      Dim ws As New NotesUIWorkspace
      Dim emailDoc As NotesDocument
      Dim rtitem As NotesRichTextItem
      Dim db As NotesDatabase
      Dim s As New NotesSession
      Set DB = S.CurrentDatabase
      Set db = session.CurrentDatabase
      Set emailDoc = New NotesDocument(db)
      Set rtitem = New NotesRichTextItem (emaildoc, "Body")       
      
'E-mail those who need to know
      SendPeople = "Employee1 Guest"
      doc.SendTo = SendPeople
      emailDoc.Form = "Memo"
      emailDoc.SendTo = SendPeople
      emailDoc.CopyTo = "James Wood"
      emailDoc.Subject = "New\Change\Remove User ID " & "("& doc.client(0) & ")"  
      
'Create the body field and put in a doclink
          'Dim rtitem As NotesRichTextItem
      Set rtitem = New NotesRichTextItem(emaildoc, "Body")
      Call rtitem.AppendText( "CTFS New/Change/Delete: "& "- -> "& doc.ChgType(0))
      Call rtitem.AddNewLine( 2 )
      Call rtitem.AppendText( "CTFS Client's Full Name: "& "- -> "& doc.CFullName(0))
      Call rtitem.AddNewLine( 2 )
      Call rtitem.AppendText( "CTFS Client's CORP User ID :"& "- -> "& doc.CCorpID(0))
      Call rtitem.AddNewLine( 2 )
      Call rtitem.AppendText( "CTFS Client's Dept.: "& "- -> "& doc.CDept(0))
      Call rtitem.AddNewLine( 2 )
      Call rtitem.AppendText( "CTFS Client's Extension: "& "- -> "& doc.CExtension(0))
      Call rtitem.AddNewLine( 2 )
      Call rtitem.AppendText( "CTFS Clients Manager: "& "- -> "& doc.CManager(0))
      Call rtitem.AddNewLine( 2 )
      Call rtitem.AppendText( "CTFS Clients Employee #: "& "- -> "& doc.CEmployeeNum(0))
      Call rtitem.AddNewLine( 2 )
      Call rtitem.AppendText( "Additional Info: "& "- -> "& doc.AddRequirements(0))
      
      
'Compute the computed fields
      Call emailDoc.ComputeWithForm(False, False)
'Send the e-mail
      Call emailDoc.Send (False)
      
      Exit Sub
AnyOtherErrors:
      Msgbox "Erl: " & Erl & Chr(13) & "Err: " & Err & Chr( 13 ) & _
      "Error: " & Error$  
End Sub
0
Comment
Question by:imjamesw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 11720674
James, couldn't you at leat ave run it through the debugger and pointed out which line failed?  You know to do that by now!!!

It may have something to do with the fact that you ditto'ed the following line:
     Set rtitem = New NotesRichTextItem (emaildoc, "Body")      
0
 

Author Comment

by:imjamesw
ID: 11720820


I have been running this thru the debugger

Sorry

This is in the Globals of the form
I think the problem is with  emailDoc.Subject = "New\Change\Remove User ID " & "("& doc.client(0) & ")"  

I did not have doc declared
I have Declared i now

Lets see what happens



0
 
LVL 31

Accepted Solution

by:
qwaletee earned 1500 total points
ID: 11720843
Well, that line contains the first reference to doc.  If you run it through the debugger, and stop before that line, you can chekc to see if doc is initialized.

If that's the problem, then you have two problems:

1) doc should have been initialized
2) doc is not declared or is icorrectly, and is being treated as a variant instead of a NotesDocument
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:imjamesw
ID: 11720893
Yeah

Doc is not initialized

I did this before and doc was not set and it worked HHMMm

Since this is in the globals of the form and I need to pull info from the form rather tha write to it how do I set doc
0
 

Author Comment

by:imjamesw
ID: 11721034
I got it

0
 

Author Comment

by:imjamesw
ID: 11721036
I forgot to set doc as uidoc
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month9 days, 13 hours left to enroll

762 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