Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Apr 2002
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts
    G'Day All,
    Have a unusual question for you all today. We have a payroll system that outputs pay slips into a single document. We run some macros over this document to apply formatting to them and make them look somewhat respectable (company logo, more readable fonts and layouts etc). This works like a treat - when Word desn't randomly delete the macros we use but that's not the problem.

    A lot of staff are requesting their payslips be emailed. We can easily output an email address on the payslip report however we reach a standstill when it actually comes to automating the email feature.

    Is there a way using VBA to extract a single page from an entire document and send it to an email contained in that page (and then repeat this process for all pages with an email address)? Is it possible using C#/VB.NET?

    I have searched and everything I come across seems to be using DOM for web pages but not Word format documents.

    Cheers
    toncc

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by toncc View Post
    Is there a way using VBA to extract a single page from an entire document and send it to an email contained in that page (and then repeat this process for all pages with an email address)?
    You will find a number of macros for splitting a large merged document into individual documents. This probably is possible because there are section breaks between the letters or other documents generated by a merge. So that would be the first step. It should not be too hard once the file is saved to combine it with a macro to automate Outlook to email an attachment. Of course there will be security prompts...

  3. #3
    Lounger
    Join Date
    Apr 2002
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Section breaks! I totally forogot about those. Thanks for the tip, I'll see what I can dig up. I wish there was a way around those Outlook prompts, but I'm yet to find one that works. I know why they put them in, but it is very annoying when you have a legitimate use for and can't turn them off.

    Thanks!

Posting Permissions

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