+ Reply to Thread
Results 1 to 2 of 2

Mail from Lotus Notes- Attach File

  1. #1
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Pune
    MS-Off Ver
    Office 365 (Win 10)
    Posts
    489

    Mail from Lotus Notes- Attach File

    Hi,
    I have the following code for sending a mail as per my requirement from an excel file


    PHP Code: 
    Private Declare Function ShellExecute Lib "shell32.dll" _
    Alias 
    "ShellExecuteA" (ByVal hwnd As LongByVal lpOperation As String_
    ByVal lpFile 
    As StringByVal lpParameters As StringByVal lpDirectory As String_
    ByVal nShowCmd 
    As Long) As Long

    Sub SendEMail
    ()
        
    Dim CopiesTo As String
        Dim Email 
    As StringSubj As String
        Dim Msg 
    As StringURL As String
        Email 
    Cells("1"51)
            
        
    Subj Cells("1"50)

        
    Msg ""
        
    Msg Msg "Dear " Cells("1"49) & "," vbCrLf vbCrLf "Your Following delivery is pending for the QC today. " vbCrLf vbCrLf Cells("1"52) & vbCrLf vbCrLf " Please complete it and reply ASAP." vbCrLf vbCrLf vbCrLf vbCrLf "NB: This mail will supersede the previous mail if you did get any with the same subject line"
        
        ' Carbon Copies
            CopiesTo = Cells("2", 49)

        
        '
    Replace spaces with %20 (hex)
        
    Subj Application.WorksheetFunction.Substitute(Subj" ""%20")
        
    Msg Application.WorksheetFunction.Substitute(Msg" ""%20")
        
        
    'Replace carriage returns with %0D%0A (hex)
        Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A")
        
        '
    Create the URL
        URL 
    "mailto:" Email "?subject=" Subj "&body=" Msg "&CC=" CopiesTo

        
        
    'Execute the URL (start the email client)
        ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus
        
        '
    Wait two seconds before sending keystrokes
        
    'Application.Wait (Now + TimeValue("0:00:02"))
        '
    Application.SendKeys "%s"
    End Sub 
    What I want is, I need to insert a file in the mail. The path along with the file name will be given in the A12 cell of "Work" tab.
    it will be something like this
    D:\Kitkat\New folder\ABC.zip
    can you please help me to modify this code for that?

    And this code is not working in our new laptops but in old only eventhough both have same excel version. After googleing, I understood that, it is because of the difference in IE version. Is there any way to make this work in both?
    Please make the Post as solved, when you get your answer & Click * if you like my suggestion

  2. #2
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Pune
    MS-Off Ver
    Office 365 (Win 10)
    Posts
    489

    Re: Mail from Lotus Notes- Attach File

    Hi,
    Can anybody pls help?

    I am ok even if it wont work in the new computer. Please help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Open up a Lotus Notes Database (not mail) create a new post and attach files VBA Excel
    By exceliscool in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2014, 03:25 PM
  2. Help! Macro to Generate email in Lotus Notes and automatically attach a file
    By elpollo87 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-27-2012, 10:19 AM
  3. Attach file to Lotus Notes without sending
    By pclive in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-10-2010, 04:49 PM
  4. Attach HTM file to Lotus Notes Mail
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-06-2009, 10:31 AM
  5. Zip File And Mail With Lotus Notes
    By mridzuan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2007, 02:22 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1