• Combining Separate/Individual Strings for Email Attachment

    From noodnutt@gmail.com@21:1/5 to All on Wed Feb 5 16:48:02 2020
    Hi Team

    I was wondering if the following was possible..?

    So! the meaty bit.

    I have two separate codes that create two different delim Files ( 1 x Pipe, the other Comma ), and would like to combine both so they attach to one email.

    I already pass one string ( the Pipe Delim ) directly to the email, which works as I expect.

    Sub myPipe()
    ' Do my Pipe Thing
    Call sendMyJobs(myFile)
    End Sub
    Sub sendMyJobs(myFile)
    ' Do the Email thing

    Sub myComma()
    ' Do my Pipe Thing
    Call sendMyJobs(myPlan)
    End Sub
    Sub sendMyJobs(myPlan)
    ' Do the Email thing

    Given that every time the user enters Transport Orders for uploading, the code will generate 2 sets of data:

    myPipe = Stored Historical data ( Pipe Delim )
    myPlan = Data Values for email only ( Comma Delim )

    I have zero idea how to structure this, so my Skewed, Pseudo Logic is thinking along the lines of creating a function enabling me to combine both strings:

    Function sendMyDelims()
    myDelims(myFile, myPlan) = myPipe(MyFile) & myComma(MyPlan)
    End Function

    Sub SendMyJobs(myDelims as String)
    'Do Stuff
    With Mail
    .Attachments.Add MyDelims
    .Display
    End With
    End Sub

    As always

    Many thanks in advance for your time.
    Mark.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From GS@21:1/5 to All on Thu Feb 6 14:15:47 2020
    Why not simply?...

    .Attachments.Add myPipe
    .Attachments.Add myPlan

    ..assuming these variables contain the full path string for separate files.

    Otherwise, if they need to be in 1 file, why not append one file's contents to the other when creating them?

    --
    Garry

    Free usenet access at http://www.eternal-september.org
    Classic VB Users Regroup!
    comp.lang.basic.visual.misc
    microsoft.public.vb.general.discussion

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From noodnutt@gmail.com@21:1/5 to All on Thu Feb 6 13:41:31 2020
    Hi Garry

    I never considered combining the actual Delim creation, I will go play with it

    Thank you for your suggestion.

    Cheers
    Mark.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Claus Busch@21:1/5 to All on Thu Feb 6 23:32:37 2020
    Hi Mark,

    Am Wed, 5 Feb 2020 16:48:02 -0800 (PST) schrieb noodnutt@gmail.com:

    So! the meaty bit.

    I have two separate codes that create two different delim Files ( 1 x Pipe, the other Comma ), and would like to combine both so they attach to one email.

    have a look:
    https://www.rondebruin.nl/win/s1/outlook/amail1.htm https://www.rondebruin.nl/win/s1/outlook/amail2.htm https://www.rondebruin.nl/win/s1/outlook/amail3.htm


    Regards
    Claus B.
    --
    Windows10
    Office 2016

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From noodnutt@gmail.com@21:1/5 to All on Wed Feb 12 14:01:47 2020
    Hi Claus

    Apologies for the tardy reply.

    I am very familiar with Ron's site as I spent a lot of time there a while ago, trying to soak up as much as I could, using his email code structure in many workbooks I have created.

    That said, I struggled for time putting this together, in both thinking how to do it, and pressure from upstairs to get it finished (my boss wants it to Go-Live ASAP, which I am distributing to our customers now). In the end I kept the Delim's separate,
    and just called each sub.

    It's dirty, but it works and it's only one extra click for the customer when clicking send.

    I will revisit it later when I have time as I have moved onto another project.

    As always, thank you so much for your contributions.

    Warm regards
    Mark.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)