-
Hi Guys
I am very new to VBA (just one week now) and I am working on a quoting system for work, which I have finished, but now need to have a button that opens an email, puts in a set statement, then adds the signature which I have set in Notes.
I have written the code below, (ok, so I copied it from the web and ammended it to suit me) and all is working apart from I dont know how to get this to insert my signature into the mail when it opens..
When I open a new mail in Notes normally, it always inserts my signature. but not when I run this module.
Additionally, there will be two users using this sheet from two separate computers, each with their own LotusNotes operating, so it will need to take the signature from their machine.
Here is the code I have so far
Sub SendQuoteToEmail()
Dim NSession As Object
Dim NDatabase As Object
Dim NUIWorkSpace As Object
Dim NDoc As Object
Dim NUIdoc As Object
Dim WordApp As Object
Dim subject As String
Dim EmailAddress As String
subject = Worksheets("Internal").Range("BD1")
EmailAddress = Worksheets("Internal").Range("BD2")
Debug.Print subject
Set NSession = CreateObject("Notes.NotesSession")
Set NUIWorkSpace = CreateObject("Notes.NotesUIWorkspace")
Set NDatabase = NSession.GetDatabase("", "")
If Not NDatabase.IsOpen Then NDatabase.OPENMAIL
Set NDoc = NDatabase.CreateDocument
With NDoc
.SendTo = EmailAddress
.CopyTo = "digitalprint@zcard.com"
.subject = subject
.body = "Dear" & " " & Worksheets("internal").Range("j10") & vbLf & vbLf & _
"Many Thanks for your enquiry" & vbLf & vbLf & _
"Please find Attached your Quotation" & vbLf & vbLf & _
"If you would like to go ahead with this order, please let me know and I will send you a template, artwork guidelines and procedures for processing your order."
.Save True, False
End With
Set NUIdoc = NUIWorkSpace.EDITDocument(True, NDoc)
With NUIdoc
Set WordApp = Nothing
End With
Set NSession = Nothing
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules