Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set a Lotus notes user name in VBA code?

Status
Not open for further replies.

mbair

Programmer
Aug 13, 2003
22
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top