Modules & VBA :: Inserting Rich Text Into Lotus Notes Email
Jul 23, 2015
I have been sending plain text emails for a while, but now I have a project where the formatting of the text needs to be specific and I need to send as rich text.
I can use the rich text from a table, excel, or word, but I am at a loss on how to get the data to Lotus Notes.
I have a VBA code to import mail from Lotus Notes into Access. The database user is able to read his email inside Access, similar to any email program.
Unfortunately, when I use the GetItemValue (lotusscript) method to read the body of the email message, Notes will render the Rich Text information as Plain Text, and I end up with no formatting information (bold letters, underline, text color, etc.)
How to import messages from Notes to Access and keep the text formatting? I am storing the data in a Rich Text Memo field in a table. I have found code to write HTML (MIME) messages, but not to import them into Access.
I'm trying to create a lotus notes email through vba that contains data from one of my access tables. Since I'd like the data to be displayed in a tabular fashion, I'm trying to format the body of the email in html.
I've got a form which emails out a report when a new record is added to my database but I'm stuck when it comes to making it send it to more than one recipient.
I came across this on the web... which suggests I should be using an array but I don't know anything about arrays.
For multiple email addresses you just set MailDoc.sendto to an array of variants each of which will receive the message. So
Code:
Dim recip(25) as variant recip(0) = "emailaddress1" recip(1) = "emailaddress2" e.t.c
maildoc.sendto = recip
My problem is I'm not sure how to implement it? My 'recipients' are being pulled from a query... how do I get that into the array of variants?
Does anybody know how I can change the default mail client from Outlook to Lotus notes? I'd like to use the sendObject utility to create a macro which sends data I enter into my form.
I want to send an email thru Lotus Notes by clicking on a command button and need some help.
I have a tabular form which displays info from a make-table query. I would like to have a command button next to each record, which when clicked will send an notice(email) to the corresponding email address.
I wish to attach to an email a specified "Shortcut" such that recipients will be able to simply click the "attachment and the Access application will open.
I have searched the forum quite extensively but the perspiration has overtaken the inspiration so any assistance would be appreciated.
Below is the complete code that I am using
Private Sub Combo206_Click()
Maint_Sup_Close = Now()' Update a field Dim Attachment As String Dim MailDoc As Object Dim AttachME As Object Dim EmbedObj As Object
Dim s As Object Dim db As Object Dim doc As Object Dim rtItem As Object Dim Server As String, Database As String Dim strError As String Dim PI As String Dim Description As String Dim Work As String
Dim Email As String Dim Docket As String
PI = Me.PI_No_1 Description = Me.Desc Email = Me.Created_Email Docket = Me.Docket_ID Work = Me.Work_Required
Set s = CreateObject("Notes.notesSession") Server = s.GETENVIRONMENTSTRING("MailServer", True) Database = s.GETENVIRONMENTSTRING("MailFile", True) Set db = s.GETDATABASE(Server, Database)
On Error GoTo ErrorLogon 'see if user is logged on Set doc = db.CREATEDOCUMENT On Error GoTo 0
Set doc = Nothing Set db = Nothing Set s = Nothing Set rtItem = Nothing
MsgBox "Message Sent"
ErrorLogon: If Err.Number = 7063 Then MsgBox " You must first logon to Lotus Notes" Set doc = Nothing Set db = Nothing Set s = Nothing Set rtItem = Nothing End If
End Sub
I am a bit out of my depth and would appreciate a guru correcting the error of my ways
I need to create an email with an Access report attached as a PDF. I am using Access 2007 and Lotus Notes.If I use SendObject with acSendReport and acFormatPDF, it opens an email just fine but the attachment is created with some random letters and numbers and .tmp as the file name.
If I use Adobe Reader to open the attachment it displays correctly as a PDF, but I need the attachment name to be .pdf so it will automatically open with Adobe for the users.Is there a way to accomplish this with Lotus Notes? I have searched this forum and found some options for Outlook users, but not for Lotus Notes.
the user opens a certain mail and THIS mail should be either saved as PDF (for example by CutePDF - as it works with a word-doc) to disk or be imported to my Access datebase in a certain field (the Body of the mail).
But I could not find code to catch just the OPENED Mail, there are a lot of examples how to loop through a Folder or a view reading all mails in it, but no one for just the ONE.
There should be something like "uidoc", but I cannot manage it.
So in real, my problem will be to "detect" the opened (or at least the marked) mail in the Notes GUI. In Outlook I do this with ActiveInspector.CurrentItem, but in Notes?
I have a function which generates a report as a RTF file, then sends it out to a list of users via Lotus Notes. The list of users is generated within the function using a query. The code worked fine while I was testing with just me in the recipients... but as soon as I add more people to the list, I get Runtime error 7294: Unable to send mail, no match found in name and address book(s) If I copy and paste the generated list into a new mail message in Lotus Notes, it accepts them all....
I THINK this is because when it's sending from Access, it's trying to use my personal address book, rather than the one that's held on the mail server... Does that sound plausible / feasible? If it does, how to change this?
I tried changing the recipients list to have the 'actual' email addresses in it rather than their names - when I did that I got no errors... but it didn't send the email, either!
I am looping through a Lotus Notes view through mails which comes with standardized content from our homepage.Some of them have one or more attachments, some mails do not have attachments. I loop through the view, read the content, write the content in a table, extract all the attachments (if there are some) and remove the mail from view this into another view.
The loops runs through without error, but is skips the mails without attachments, so that after the "first loop" all mails without attachments remain in the view, whereas all with attachments have been processed accordingly.With another start of the function all the mails WITHOUT attachments are processed accordingly as well.This is not logic for me, as all code I found on the web looks like this:
Do While Not LNDoc Is Nothing Set NxtDoc = LNView.GetNextDocument(LNDoc) 'check if Attachments are in the mail !!!!!! If LNDoc.HasEmbedded Then <----
I receive mails through LN and loop through a certain folder, reading DeliveredDate, Body, Subject and writing those items into an Access-table.This works fine, before I go for the loop I put the doc in another folder and remove the current doc from the folder.
Call LNDoc.PutInFolder("SMSBackup", False) Call LNDoc.RemoveFromFolder("SMSResponse") Set LNDoc = LNView.GetNextDocument(LNDoc) Loop
Without any error, without anything abnormal in the mails the code exits after a few loops, sometime after more or sometime after less read mails.The problem ist the RemoveFromFolder, not the PutInFolder function.
So to avoid this behavoir, I changed my code to finish the loop without Call LNDoc.PutInFolder("SMSBackup", False) Call LNDoc.RemoveFromFolder("SMSResponse")
and added after the loop a NotesCollection which should do ALL at once.But this part of the code does nothing at all (allthough found on the web).
With LNCollection .PutAllInFolder "SMSBackup", False .RemoveAllFromFolder "SMSResponse" End With
The complete code looks like this:
Set objNotes = GetObject("", "Notes.NotesSession") Set LNdb = objNotes.GetDatabase("myServer", "MyNSF") If Not LNdb.IsOpen Then LNdb.OpenDatabase If Not (LNdb Is Nothing) Then Set LNView = LNdb.GetView("SMSResponse")
I am close to getting code to send an email from access with the body of the email populated with a Rich Text textbox from my access form. The problem I am having is that the body of the email is converted to plain text in Outlook which is creating problems for me. How to identify what I can do to convert to rich text or HTML in Outlook? I also want to attach a table that is populated by a query in my application, but i haven't got that far yet.
I've worked with Access before but I've never had to setup mass mailing using Lotus Notes retrieving the data from Access.
I'm basically working with Access 2003 with a database containing all the clients information with email and personalised messages and it needs to be sent out through Lotus Notes R5 Release 5.0.11
I've done searches on this site and I've found many codes but I was wondering if there was a beginner's guide to this.
If anyone has links to where I can read up on it that would be great too.
Your help is much appreciated. Thanks in advance for your help.
I have a list box which has several columns. What i'm trying to do is have a button that when clicked takes the values of the selected list box item and put them into a new lotus notes email. It doesn't need the address or any other detail, just the info into a new mail. I have seen some post's here but not sure i understand them (bit of a noob to access/vba).
Is this possible to do and can someone please point me in the right direction?
I am sending emails when the user press a button, but the problem is:
1 - How to check is LNotes is open 2- How to know if the user needs to enter the password.
With the following code an email is sent ONLY if notes is open AND the psw is not required.
Public Sub Sendmailf(Task As String)
Dim nSession As Object Dim CurrentUser As String Dim DataBaseName As String Dim nDatabase As Object Dim nMailDoc As Object Dim nSendTo(60) As String 'array for 60 e-mail address Dim EmbeddedObj As Object
Set nSession = CreateObject("Notes.NotesSession") CurrentUser = nSession.username DataBaseName = Left$(CurrentUser, 1) & Right$(CurrentUser, _ (Len(CurrentUser) - InStr(1, CurrentUser, " "))) & ".nsf" Set nDatabase = nSession.GETDATABASE("", DataBaseName) Call nDatabase.OPENMAIL Set nMailDoc = nDatabase.CREATEDOCUMENT With nMailDoc
I used sendobject to send the object via Lotus Notes, but I want to skip to click the Send button from the Lotus Notes, everytime, when I sent, it goes to the Lotus Notes, then I need to click the send button again on the Lotus Notes for confirmation to send the mail. How can I skip it?
Hello everyone, I am having some issues getting past primary keys. A little background on what I am doing:
I am a Lotus Notes Programmer by design. We have decided to move away from Lotus and Access seems to be the choice to replace some of our applications. I have created a DB in access 2003. I have my tables created. I have my forms created. I was able to export from notes about 70,000 documents. In notes I had one main form and from that one could create any number of children documents(the parent doc generates the key and its passed to all the children documents...so some records in a ccess in the same table will have the same key. I set to DUP's OK for those tables). The documents are link by their unique document ID's. Well I needed to maintain that relationship when importing the documents to access. Which is working without a hitch. BUT where I am stuck is on new records. I need the same field that is linking all of the imported documents to autogenerate a primary key for new records..and I need that key to be passed to all the other tables in which I am storing all of the other children documents(records). Not sure how to get this done...
I hope I explained enough if not please me know what other information you need to try and help me out.
We need to move rich text from an Access memo field to a Word text box. So far the best Ive been able to come up with is in the code below. In this code pprs!What is a record set field of a table memo field that is bound to a text box enabled for rich text. The rich text seems to be stored as html as so I can get word to convert it by enclosing it in html tags.
Dim What As Word.Shape Set What = doc.Shapes.AddTextbox(msoTextOrientationHorizontal , doc.PageSetup.LeftMargin, 225, 534, 0) Dim sPath As String sPath = "G:Temp.html" Open sPath For Output As 1 Print #1, "<HTML>" & pprs!What & " </HTML>" Close #1 What.TextFrame.TextRange.InsertFile (sPath)
I'm trying to output some logging to a form with a Rich text textbox
This is what the form is displaying: 14:16:32: check OK: 500<10000andS235='s460'> 14:16:32: check OK: 500<10000andS235='s355'> 14:16:32: check failed:too short 500<1000231231 > 14:16:32: Ready ...
There is some coloring in the text but I'm not display that here (copy/paste of the textbox)
This is the HTML behind it (? txtbox in imm.window): 14:16:32: <font color=black>check OK: 500<10000andS235='s460'</font><br />14:16:32: <font color=black>check OK: 500<10000andS235='s355'</font><br />14:16:32: <font color=red><strong>check failed:too short 500<1000231231 </strong></font><br />14:16:32: <font color=green><strong>Ready ... </strong></font><br />
The problem is in the red > that are added to each line. I have no clue where they are coming from, in fact: they are NOT in the HTML.When I display this piece of HTML in IE I don't get the red > behind each line.I have tried to use <p> of <div> instead of <br/> but that makes no difference
I'm using Access 2010. I'm passing a string into the OpenArgs of my report - works fine. In the report there are 3 rich text fields which may contain the text I passed in, and if so I want to change the color of that text to red so it stands out.
The value passed to the report changes so I'll need to use VBA in the detail's format section to check each of the 3 rich text fields.