Hi every one!I am a project student, currently having my attachment in a company from my school. I have alittle problem here. I’m trying to do a sequential number. This codes are inside my save&send e-mail button. It kept giving me an ERROR that says OBJECT VARIABLE NOT SET. I checked this mistake, it said that i needed to use “SET”. But what do i need to set? All my “Dim” has been set. Please help me! Thank u for the time and God bless u all.
Sub Click(Source As Button)
Dim wSpace As New notesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Set uidoc = wSpace.CurrentDocument
Set doc = uidoc.Document
Dim session As New NotesSession
Dim db As notesdatabase
Dim view As NotesView
Dim newdoc As NotesDocument
Dim docB As NotesDocument
Dim rt As NotesRichTextItem
Set db=session.CurrentDatabase
Set newdoc=New notesdocument(db)
Set view = db.GetView("SV")
Set docB = view.GetDocumentByKey ("fNumber")
Set rt = New NotesRichTextItem (newdoc, "Body")
Dim n As Integer
n=docB.FormNumbers(0)
Call uidoc.Refresh
'get new ID Number
If doc.IsNewNote Then
n=n+1
num = "Form Number" & Right ("0000"&n,4)
doc.fNumber = num
docB.FormNumbers = n
Call docB.Save (True,False)
doc.ProcessStatus = "1"
End If
Call rt.AppendDocLink(doc,"Sales Form") 'form attached
newdoc.form = "Sales Form"
newdoc.from = "Put from name here or ignore if you want to show your name"
newdoc.sendto = doc.PersonToConfirm
newdoc.subject = "Sales Form" & " " & uidoc.FieldGetText("custName")
Call rt.AppendText ("Attachments is for you to approve") 'body text
Call rt.AddNewline(2) 'create new line
'Save documents
Call uidoc.Save
newdoc.form = "Bookmark"
Call newdoc.Send (YES, doc.PersonToConfirm)
'If doc.IsNewNote Then
'n = n + 1
'num = "Form Number" & Right("0000" & n , 4)
'docA.fNumber = num ' in the main
'docB.formNo = n ' in the FN
'Call docB.Save( True, False )
'docA.ProcessStatus = "Save & Send Form"
'End If
Messagebox "Email was sent ",0+64, "Success!"
Call uidoc.Close
End Sub