Results 1 to 9 of 9
  1. #1
    4 Star Lounger
    Join Date
    May 2001
    Location
    Oxfordshire
    Posts
    456
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi, I'm looking to e-mail a report (from a button on a form), but would like to send it in Snapshot format (or pdf as we've got CutePDF), but I'm struggling to find the appropriate syntax for the SendObject command.

    This is how far I've got;

    stDocName = "rptSIR"
    DoCmd.SendObject acReport, stDocName,


    I knowit's the next part, but what????

  2. #2
    4 Star Lounger
    Join Date
    May 2001
    Location
    Oxfordshire
    Posts
    456
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK, I've found a solution for that one, but now I want to filter the result to the current/selected record.


    Any ideas???

    PS here's where I'm at, at the mo';

    DoCmd.SendObject acReport, stDocName, "SnapshotFormat(*.snp)"

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    [quote name='Egg 'n' Bacon' post='793278' date='15-Sep-2009 00:44']OK, I've found a solution for that one, but now I want to filter the result to the current/selected record.


    Any ideas???

    PS here's where I'm at, at the mo';

    DoCmd.SendObject acReport, stDocName, "SnapshotFormat(*.snp)"[/quote]
    I have used that approach before (in creeating a pdf file) then using a special sub SendMail to send that file as an attachment.
    I didn't use sendobject, i set the printer to pdf995 in the page setup of the report.
    .
    Try searching for sendMail in here.

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    [quote name='Egg 'n' Bacon' post='793278' date='15-Sep-2009 00:44']OK, I've found a solution for that one, but now I want to filter the result to the current/selected record.

    DoCmd.SendObject acReport, stDocName, "SnapshotFormat(*.snp)"[/quote]
    If you open the report in Preview mode, at the current record, before you use Send Object, it will send the currently open report - i.e. just the current record.

    What Version of Access are you using? 2007 has built in support for pdf, but earlier versions don't. So in 2007 you can send as pdf by using SendObject and just changing the format to pdf. In earlier versions you need to use completely different code as Pat has suggested.
    Regards
    John



  5. #5
    4 Star Lounger
    Join Date
    May 2001
    Location
    Oxfordshire
    Posts
    456
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='johnhutchison' post='793322' date='14-Sep-2009 23:37']If you open the report in Preview mode, at the current record, before you use Send Object, it will send the currently open report - i.e. just the current record.

    What Version of Access are you using? 2007 has built in support for pdf, but earlier versions don't. So in 2007 you can send as pdf by using SendObject and just changing the format to pdf. In earlier versions you need to use completely different code as Pat has suggested.[/quote]

    Thanks for the replies guys. Sorry I haven't replied before now (2 day course).

    I am using 2007, and your solution , John, sounds like just what I need. Do you know the syntax for that output? I tried "PDFFormat(*.pdf)", but it didn't like that.

    TIA

    OK, needed to install the add-on.

    Many thanks.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Instead of the literal string "SnapshotFormat (*.snp)", you can also use the symbolic constant acFormatSNP, and instead of "PDFFormat (*.pdf)", you can use acFormatPDF.

  7. #7
    4 Star Lounger
    Join Date
    May 2001
    Location
    Oxfordshire
    Posts
    456
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='793683' date='17-Sep-2009 10:47']Instead of the literal string "SnapshotFormat (*.snp)", you can also use the symbolic constant acFormatSNP, and instead of "PDFFormat (*.pdf)", you can use acFormatPDF.[/quote]

    Now that is a bit weird; using the string didn't work, so I ended up using acformatPDF

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    There needs to be a space between Format and ( in the string.

  9. #9
    4 Star Lounger
    Join Date
    May 2001
    Location
    Oxfordshire
    Posts
    456
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='793702' date='17-Sep-2009 12:33']There needs to be a space between Format and ( in the string.[/quote]

    It's good you said; I would never have found that.

    Cheers mate

Posting Permissions

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