• SendObject – Snapshot format

    Author
    Topic
    #462489

    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????

    Viewing 0 reply threads
    Author
    Replies
    • #1177267

      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)”

      • #1177289

        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)”

        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.

      • #1177299

        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)”

        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.

        • #1177688

          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.

          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.

          • #1177690

            Instead of the literal string “SnapshotFormat (*.snp)”, you can also use the symbolic constant acFormatSNP, and instead of “PDFFormat (*.pdf)”, you can use acFormatPDF.

            • #1177699

              Instead of the literal string “SnapshotFormat (*.snp)”, you can also use the symbolic constant acFormatSNP, and instead of “PDFFormat (*.pdf)”, you can use acFormatPDF.

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

            • #1177704

              There needs to be a space between Format and ( in the string.

            • #1178285

              There needs to be a space between Format and ( in the string.

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

              Cheers mate

    Viewing 0 reply threads
    Reply To: SendObject – Snapshot format

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: