VBA push button script for attaching PDF and email using Mozilla Thunderbird

  • Hi, I'm very new to using VBA script, macros etc.


    I'm currently building a workbook which helps me in my Job and I want to be able to send a PDF of a Progress chart to my boss by a single click within the sheet using a VB Push button.I managed to create the push button to save to PDF and also another to open Mozilla Thunderbird program.


    However I would like to be able to attach as .pdf and send with the title, email address etc automatically. I've been through many pages and website and have not found a working answer.


    thanks

  • Re: VBA push button script for attaching PDF and email using Mozilla Thunderbird


    Problem is Thunderbird does not expose a COM interface so you cannot 'program' it directly like Outlook.


    You can try using SendKeys' to send keystrokes to the ThunderBird app but you'll tear your hair out trying to get it to work consistently, or even at all. The only other option is to Shell Thunderbiard passing all the components to make up an email as parameters on the command line. for example:

    Where strTO and strSubject have been populated earlier in the code (saving my time here)
    Note also that ThunderBird uses symbols after certain fields ('?' after the 'To' field as an example), you need to investigate these, I'm not sure of all the conventions used.


    Attachments can be added using something like

    Code
    strCmd  = strCmd  & "attachment=" & strAtt   '// Again defined and populated elsewhere


    But again you need to check the exact syntax.


    (Rough 'pseudo' code - I'm not saying it is correct or will run - just to illustrate how. I don't have access to ThunderBird so cannot test)

  • Re: VBA push button script for attaching PDF and email using Mozilla Thunderbird


    Thanks for the Quick reply, but as I'm very new to VB I don't quite get what I need to do as per the above code. Will I be able to just paste this in and it will work?


    thanks again

  • Re: VBA push button script for attaching PDF and email using Mozilla Thunderbird


    Quote

    Will I be able to just paste this in and it will work


    Quote from Cytop

    I'm not saying it is correct or will run - just to illustrate how


    Please actually read my previous post.


    If you are a beginner with VBA then unfortunately you are going to have some issues with this but it will be an excellent learning experience if, rather than just looking for 'ready made' code, you do actually want to learn.


    I can't help with specifics as I don't have (and don't want) Thunderbird, but I'd be happy to help with the VBA syntax. That leaves investigating the Thunderbird command line syntax down to you.

  • Re: VBA push button script for attaching PDF and email using Mozilla Thunderbird


    Thanks for pointing out that I didnt actually read your comment. cheers

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!