Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Print guidance (2002)

    I am going to be building a report that is used as an invoice for different accounts. There can be an many as 700 or more invoices at a time. Before I start doing this I'm looking for input on the best way to set this up and/or if the following is even possible. First, is there a way to print the invoices separately to a folder on the the users harddrive. They could be saved in .pdf format if that is possible. I know the user is not going to want to print each invoice separately. The reason I'm looking for a way to save them individually because the user will then be emailing them to the different accounts. The secon part of the question is, is there a way to automate attatching these files to email without having to do it 700+ times and if so, would I do it from Access or Outlook itself?

    Thanks,
    Leesha

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Print guidance (2002)

    You can output a report to a file and e-mail it using DoCmd.SendObject. This doesn't work with .pdf format, though - you can output to plain text, Word, Excel, snapshot and HTML. See <post#=438149>post 438149</post#> and <post#=275460>post 275460</post#> for examples.
    If you prefer .pdf format, you need software to create .pdf files, and you must control Outlook from Access using Automation. This is more complicated; if you search this forum for Outlook.Application, you'll find examples.

    If you start sending e-mails from code (whichever method you use), you'll run into security problems - after a rash of mail viruses Microsoft decided to make automated sending of e-mail more difficult. See <post#=317048>post 317048</post#> for ways to get around this.

    It might be a good idea to send the mails in batches of fewer than 700. Some ISPs limit the amount of mail that can be sent within a short period, to discourage spamming.

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Print guidance (2002)

    Hi Hans,

    Outputting to Word or Excel will be OK so that would handle the pdf issue. I hadn't thought of the security or ISP limits so I will keep that in the back of my mind (I'm glad I asked the question before automating this).

    To clarify, so I'm clear. If the report contains 700+ separate invoices that will go to 700+ different addresses, what do I need to consider when building this so that the docmd.sendobject sends it as 700+ different word file to a folder vs one word file containing all the invoices?

    Thanks,
    Leesha

  4. #4
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Print guidance (2002)

    Never mind. I see that the links you sent will show me how to set this up to break into multiple files. I'll study this more closely.

    Thanks!
    Leesha

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Print guidance (2002)

    Docmd.sendobject allows you to attach a database object (e.g a report) in a specified format (e.g snapshot), but it does not allow the attachment of a file from outside the database.

    So you can't do this in two steps - i.e. first save the invoice as a file in a specified folder, then use docmd.sendobject to send it to someone.


    Outlook automation does allow you to do it in two steps, because it does allow you to specify a file as an attachment.
    Regards
    John



Posting Permissions

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