This is my code and I need to exactly where to put the user or capture the current user name for the Lotus notes database when it opens.
Public Sub OPENNOTES(Location As String, Dateopened As String, Desc As String, ddrpass As String, ticketnum As String)
Dim LOTSESSION As Domino.NotesSession
'Dim LOTSESSION As Object
Dim lotDocument As Domino.NotesDocument
'Dim lotDucment As Object
Dim lotDatabase As Domino.NotesDatabase
'Dim lotDatabase As Object
Dim vRecipients As Variant
Dim AttachME As Domino.NotesRichTextItem
Dim EmbedObj As Domino.NotesEmbeddedObject
Dim StrFilename As String
Dim StrFilename2 As String
Dim rtitem As Object
Set LOTSESSION = New Domino.NotesSession
With LOTSESSION
.Initialize "letmein"
'or u can use
'an inputbo
End With
Set lotDatabase = _
LOTSESSION.GetDbDirectory("xxx".OpenMailDatabase
With lotDatabase
If Not .IsOpen Then
.Open
End If
End With
vRecipients = Array("somname@yahoo.com", _
"somename@somecompany.com", _
"recipient@domain" _
)
Set lotDocument = lotDatabase.CreateDocument()
'Set rtitem = lotDocument.CreateRichTextItem("Body"
With lotDocument
.AppendItemValue "Form", "Memo"
.AppendItemValue "Subject", "Location: " & Location & " " & "Date Opened: " & Dateopened & " " & "Ticket number: " & ticketnum & " " & "DDR: " & ddrpass
.AppendItemValue "Body", Desc
' .AppendItemValue "Body2", "StrFilename"
End With
'attach file
'Set Body2 = rtitem.EmbedObject(1454, "", StrFilename)
lotDocument.Send False, vRecipients
Set lotDocument = Nothing
Set lotDatabase = Nothing
Set LOTSESSION = Nothing
End Sub
Public Sub OPENNOTES(Location As String, Dateopened As String, Desc As String, ddrpass As String, ticketnum As String)
Dim LOTSESSION As Domino.NotesSession
'Dim LOTSESSION As Object
Dim lotDocument As Domino.NotesDocument
'Dim lotDucment As Object
Dim lotDatabase As Domino.NotesDatabase
'Dim lotDatabase As Object
Dim vRecipients As Variant
Dim AttachME As Domino.NotesRichTextItem
Dim EmbedObj As Domino.NotesEmbeddedObject
Dim StrFilename As String
Dim StrFilename2 As String
Dim rtitem As Object
Set LOTSESSION = New Domino.NotesSession
With LOTSESSION
.Initialize "letmein"
'or u can use
'an inputbo
End With
Set lotDatabase = _
LOTSESSION.GetDbDirectory("xxx".OpenMailDatabase
With lotDatabase
If Not .IsOpen Then
.Open
End If
End With
vRecipients = Array("somname@yahoo.com", _
"somename@somecompany.com", _
"recipient@domain" _
)
Set lotDocument = lotDatabase.CreateDocument()
'Set rtitem = lotDocument.CreateRichTextItem("Body"
With lotDocument
.AppendItemValue "Form", "Memo"
.AppendItemValue "Subject", "Location: " & Location & " " & "Date Opened: " & Dateopened & " " & "Ticket number: " & ticketnum & " " & "DDR: " & ddrpass
.AppendItemValue "Body", Desc
' .AppendItemValue "Body2", "StrFilename"
End With
'attach file
'Set Body2 = rtitem.EmbedObject(1454, "", StrFilename)
lotDocument.Send False, vRecipients
Set lotDocument = Nothing
Set lotDatabase = Nothing
Set LOTSESSION = Nothing
End Sub