[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

10/29/2003 at 11:04AM PST, ID: 20782076
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.2

Lotus Notes Email from VBA Excel Worksheet {Formated Text}

Asked by dwanders in Lotus Notes

Tags: lotus, notes, vba, excel, email

I have been trying to get a MS Excel spread sheet to email specific content of an Excel sheet to an email message. I have found the code that allows for me to generate an email message and that work swimmingly. Especially if I wanted to attach the Spread sheet (works great as well). What I would really like to do (that I have determined cannot be done because the NotesUI does not support COM) is esentially:

VBA for Excel -> Select Cells -> Paste into a Notes Document (maintaining the Cell Formatting).

The code that I have (see end of question) that works will only copy the text to the email document (I have removed all comments for the code, I originally got this code from the internet and modified it slightly to give credit to the owner whoever they may be).

I have given up on the Copy and Paste approach (which would have worked great) and have decided to try and use HTML formatting to get as close to the results that I would like. I am thinking some thing like:

Dim BodyText As String -- > Then --> BodyText = "MY HTML Code" --> then dump that to the Body of the email message. Which does not work, the text is exactly as I send it, but the client does not execute the HTML - it displays it. I have been trying to figure out Lotus Notes PassThru HTML but cannot get it to work either.

Any suggestions or pointers will be greatly appreciated.  
 
##### Begin Excel VBA Code to pass email to Notes #####

Private Sub CommandButton1_Click()
    Dim Maildb As Object        'The mail database
    Dim UserName As String      'The current users notes name
    Dim MailDbName As String    'The current users notes mail database name
    Dim MailDoc As Object       'The mail document itself
    Dim AttachME As Object      'The attachment richtextfile object
    Dim Session As Object       'The notes session
    Dim EmbedObj As Object      'The embedded object (Attachment)
    Dim Subject As String       'The subject string
    Dim Attachment As String    'The path to the attachemnt string
    Dim Recipient As String     'The Recipient string (or you could use the list)
    Dim Recip(10) As Variant    'The Recipient list
    Dim BodyText As String      'The body text
    Dim SaveIt As Boolean       'Save to sent mail
    Dim WasOpen As Integer      'Checking to see if the Mail DB was already
                                'open to determine if session should be
                                'closed (0) or left alone (1)
    Dim ClipBoard As DataObject 'Data object for getting text from clipboard
    Subject = "This is a Test Email Messag"
    Recipient = "Notes Email User"pying it to Clipboard
    Sheets("Sheet1").Select
    Range("A5:G19").Select
    Selection.Copy
    Set ClipBoard = New DataObject
    ClipBoard.GetFromClipboard
    SaveIt = True
    Set Session = CreateObject("Notes.NotesSession")
    UserName = Session.UserName
    MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
    Set Maildb = Session.GETDATABASE("", MailDbName)
    If Maildb.ISOPEN = True Then
         WasOpen = 1      'Already open for mail
     Else
         WasOpen = 0
         Maildb.OPENMAIL    'This will prompt you for password
     End If
    Set MailDoc = Maildb.CREATEDOCUMENT
    MailDoc.Form = "Memo"
    MailDoc.sendto = Recipient      'Or use Racip(10) for multiple
    MailDoc.Subject = Subject
    MailDoc.body = ClipBoard.GetText(1)
    MailDoc.SAVEMESSAGEONSEND = SaveIt
    If Attachment <> "" Then
        Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment")
        Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment, "Attachment")
        MailDoc.CREATERICHTEXTITEM ("Attachment")
    End If
    MailDoc.PostedDate = Now() 'Gets the mail to appear in the sent items folder
    MailDoc.SEND 0, Recipient
    'Clean Up'
    Range("A1").Select
    Application.CutCopyMode = False
    Set Maildb = Nothing
    Set MailDoc = Nothing
    Set AttachME = Nothing
    Set EmbedObj = Nothing
    If WasOpen = 1 Then
        Set Session = Nothing
    ElseIf WasOpen = 0 Then
        Session.Close
        Set Session = Nothing
    End If
   
    MsgBox "The Line Down Email was sent", vbOKOnly
       
End Sub

Thanks again in advance
 
Keywords: Lotus Notes Email from VBA Excel Wor…
 
Loading Advertisement...
 
[+][-]10/29/03 11:35 AM, ID: 9644794

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]10/29/03 11:46 AM, ID: 9644884

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/29/03 12:12 PM, ID: 9645056

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/29/03 01:21 PM, ID: 9645611

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/30/03 12:03 AM, ID: 9648351

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/30/03 06:03 AM, ID: 9650093

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/30/03 07:36 AM, ID: 9650812

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/31/03 08:09 AM, ID: 9658465

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]10/31/03 10:42 AM, ID: 9659558

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/31/03 11:28 AM, ID: 9659880

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/31/03 12:24 PM, ID: 9660258

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/31/03 02:35 PM, ID: 9661013

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/03/03 07:21 AM, ID: 9671410

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/03/03 07:45 AM, ID: 9671647

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/04/03 10:24 PM, ID: 9684681

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Lotus Notes
Tags: lotus, notes, vba, excel, email
Sign Up Now!
Solution Provided By: qwaletee
Participating Experts: 4
Solution Grade: B
 
 
[+][-]11/05/03 05:56 AM, ID: 9686626

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/05/03 07:28 AM, ID: 9687416

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91