+ Reply to Thread
Results 1 to 12 of 12

Attaching PDF to Lotus Notes email. PDF name is variable.

Hybrid View

joee74 Attaching PDF to Lotus Notes... 09-15-2013, 11:12 AM
joee74 Re: Attaching PDF to Lotus... 09-16-2013, 04:13 AM
JOHN H. DAVIS Re: Attaching PDF to Lotus... 09-16-2013, 06:59 AM
joee74 Re: Attaching PDF to Lotus... 09-16-2013, 07:18 AM
JOHN H. DAVIS Re: Attaching PDF to Lotus... 09-16-2013, 07:35 AM
joee74 Re: Attaching PDF to Lotus... 09-16-2013, 07:42 AM
JOHN H. DAVIS Re: Attaching PDF to Lotus... 09-16-2013, 07:54 AM
joee74 Re: Attaching PDF to Lotus... 09-17-2013, 06:27 AM
joee74 Re: Attaching PDF to Lotus... 09-17-2013, 06:35 AM
JOHN H. DAVIS Re: Attaching PDF to Lotus... 09-17-2013, 07:03 AM
joee74 Re: Attaching PDF to Lotus... 09-17-2013, 07:55 AM
JOHN H. DAVIS Re: Attaching PDF to Lotus... 09-17-2013, 07:59 AM
  1. #1
    Registered User
    Join Date
    03-12-2013
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Attaching PDF to Lotus Notes email. PDF name is variable.

    Hi John

    thanks for this, I have run this macro and its getting hung up on the create PDF element I had place in for creating the client price PDF.

    The following error message is being displayed.

    Run-Time error '1004:

    Document not saved, the document may be open, or error may have been encountered when saving.

    Its creating the email but still not attaching the PDF.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Attaching PDF to Lotus Notes email. PDF name is variable.

    Maybe:

    Sub joee74yyy()
        Dim NSession As Object
        Dim NDatabase As Object
        Dim NUIWorkSpace As Object
        Dim Attachment1 As String
        Dim AttachME As Object
        Dim EmbedObj1 As Object
        Dim NDoc As Object
        Dim NUIdoc As Object
        Dim WordApp As Object
        Dim subject As String
        Dim EmailAddress As String
        Dim s(1 To 21) As String
         
        subject = Worksheets("Client Quote").Range("AY8")
        EmailAddress = Worksheets("Client Quote").Range("ay10")
         '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 = "test@test.com, " & "test1@test.com, " & "test2@test.com"
                    .subject = subject
            s(1) = "Dear" & " " & Worksheets("internal").Range("j10")
            s(2) = ""
            s(3) = "Many Thanks for your enquiry"
            s(4) = ""
            s(5) = "Please find attached your quotation for your request" & " " & " : - " & "'" & Worksheets("internal").Range("j14") & "'"
            s(6) = ""
            s(7) = "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."
            s(8) = ""
            s(9) = "Kind Regards"
            s(10) = ""
            s(11) = Worksheets("sheet3").Range("a58")
            s(12) = Worksheets("sheet3").Range("a59")
            s(13) = ""
            s(14) = "Z-CARD® PocketMedia® Solutions"
            s(16) = ""
            s(17) = Worksheets("sheet3").Range("a61")
            s(18) = Worksheets("sheet3").Range("a62")
            s(19) = ""
            s(20) = "7-11 St. Johns Hill, London, SW11 1TN"
            s(21) = "The PocketMedia® Agency | www.zcard.co.uk"
               
                  
            .body = Join(s, vbCrLf) & " "
            
            .Save True, False
        End With
         
        NUIWorkSpace.EDITDOCUMENT True, NDoc
         
            Worksheets("client quote").ExportAsFixedFormat Type:=xlTypePDF, _
            Filename:="C:\Users\joeellis\Desktop\Digital Quotes\Client Prices\" & _
            Worksheets("client quote").Range("AY8").Value & ".pdf", _
            OpenAfterPublish:=True
    
            activeworkbook.save
            
            ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
            Filename:="C:\Users\joeellis\Desktop\Digital Quotes\Internal Prices\" & _
            ActiveSheet.Range("BD2").Value & ".pdf", _
            OpenAfterPublish:=False
            
            activeworkbook.save
    Attachment1 = "C:\Users\joeellis\Desktop\Digital Quotes\Client Prices\" & _
            Worksheets("client quote").Range("AY8").Value & ".pdf"
    
    If Attachment1 <> "" Then
    On Error Resume Next
    Set AttachME = NDoc.CREATERICHTEXTITEM("attachment1")
    Set EmbedObj1 = AttachME.embedobject(1454, "attachment1", "C:\Users\joeellis\Desktop\Digital Quotes\Client Prices\" & _
            Worksheets("client quote").Range("AY8").Value & ".pdf", "")
    On Error Resume Next
    End If
    
        Set NDoc = Nothing
        Set WordApp = Nothing
        Set NSession = Nothing
        Set NSession = Nothing
        Set AttachME = Nothing
        Set EmbedObj1 = Nothing
             
    End Sub

+ 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. Attaching ZIpFiles with Lotus Notes
    By TonyforVBA in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-30-2010, 08:15 AM
  2. Email Workbook through Lotus Notes
    By nih in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-31-2009, 10:09 AM
  3. Email Information in Lotus Notes
    By tobeinvented in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-29-2009, 02:23 AM
  4. Why won't AOL email communicate with lotus notes email?
    By ManInaMaze in forum Excel General
    Replies: 0
    Last Post: 08-02-2005, 10:05 PM
  5. [SOLVED] Email using Lotus Notes & FollowHyperlink
    By Glenn Ray in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2005, 04:06 PM

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