troubleshooting Question

Object Variable Not Set

Avatar of jforget1
jforget1 asked on
Lotus IBM
3 Comments1 Solution601 ViewsLast Modified:
Have a strange one here. Have an agent that I have used in the past to send out emails to users. THe issue that I have is there is a field with their office ID. The field type is Text and I have dimmed it as a string. The cause I think here is the value in the field is all numbers (e.g. 123) Would that alone cause a type mismatch even though the field type is set to Text? In the Declarations for the agent it is coded Dim Agency As String

My break is happening on this line  
emaildoc.Subject = doc.Agency + " has devices to replace."

Any tips?
Sub Initialize
	Dim s As New NotesSession 
	Set db = s.CurrentDatabase 
	Set v = db.getview("out_of_scope_nef")
	Set vnav = v.createviewnav
	Set ventry = vnav.getfirst
'Process uniform information for all docs in office
	Do Until ventry Is Nothing  
' Build the top of the document
		arraycount = 0
		saveoffice = ventry.columnvalues(0)
		Set emaildoc = db.CreateDocument 
		emaildoc.form = "out_scope_letter_om_nef"           'Form name of Letter 
		emaildoc.SendTo =  ventry.columnvalues(1) 
		emaildoc.CopyTo =  ventry.columnvalues(2) 

		Call RedimArrays
		username(arraycount) = ventry.columnvalues(3)
		dai(arraycount) = ventry.columnvalues(4)
		desc(arraycount) = ventry.columnvalues(5)
		svc_tag(arraycount) = ventry.columnvalues(6)
		status(arraycount) = ventry.columnvalues(7)
		Arraycount = arraycount + 1
	' Set flag on original document being processed
		Set doc = ventry.document
		doc.om_letter1_flag = "done"
		Call, True)
		Set ventry = vnav.getnext(ventry)
		If ventry Is Nothing Then Goto WriteLast
		If ventry.columnvalues(0) = saveoffice Then 
			Goto ProcessEntry
			emaildoc.username = username
			emaildoc.dai = dai
			emaildoc.Agency = Agency
			emaildoc.desc = desc
			emaildoc.svc_tag = svc_tag
			emaildoc.status = status
			emaildoc.Agency = doc.Agency
			emaildoc.Principal = "Field Technology"
			emaildoc.Subject = doc.Agency + " has devices to replace."
			Call emaildoc.send(True)
			arraycount = 0
			Call CleanArrays
		End If
End Sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros