Results 1 to 12 of 12
  1. #1
    nhkhurum is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2013
    Posts
    17

    Output format in SendObject Macro

    Hi Frnds


    Any one guide me how i can add "*.PDF format in send object format. Snapshot is below.
    Code:
    Code:
    Code:
    [QUOTE][/QUOTE


  2. #2
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    "PDFFormat(*.pdf)"

    If you are sending to each records one after another then do this

    Code:
    DoCmd.OpenReport "rptYourReport", acViewPreview, DoCmd.SendObject acSendReport, , "PDFFormat(*.pdf)", Me.YourEmailField, , , , , True
    Docmd.CloseReport "rptYourReport"
    the DoCmd.SendObject acSendReport, , "PDFFormat(*.pdf)" will send object as PDF

    if you are running through a recordset (advanced) then you will need to open the report first and after sending it you will need to close it to allow you to open the next records report.

    if you are just putting a send report as pdf button then

    DoCmd.SendObject acSendReport, , "PDFFormat(*.pdf)" will do

    you can also use the button wizard to simply let it help you create a marco that will send the report as a pdf.

  3. #3
    nhkhurum is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2013
    Posts
    17

    Pdf

    plz give me step by step advise where i need to past this code.




    Quote Originally Posted by Ruegen View Post
    "PDFFormat(*.pdf)"

    If you are sending to each records one after another then do this

    Code:
    DoCmd.OpenReport "rptYourReport", acViewPreview, DoCmd.SendObject acSendReport, , "PDFFormat(*.pdf)", Me.YourEmailField, , , , , True
    Docmd.CloseReport "rptYourReport"
    the DoCmd.SendObject acSendReport, , "PDFFormat(*.pdf)" will send object as PDF

    if you are running through a recordset (advanced) then you will need to open the report first and after sending it you will need to close it to allow you to open the next records report.

    if you are just putting a send report as pdf button then

    DoCmd.SendObject acSendReport, , "PDFFormat(*.pdf)" will do

    you can also use the button wizard to simply let it help you create a marco that will send the report as a pdf.

  4. #4
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by nhkhurum View Post
    plz give me step by step advise where i need to past this code.

    ok, firstly please do not paste this code - understand it.

    In order for you to have the action of send object you require something to happen - an event.

    Each event causes something to occur.

    In our case a on the click of a button event. An OnClick() function.

    There is a properies info box that allows you to see the properties on the control of a form. A control like a button that you place on the form using the form designer.

    So create a button, open that buttons properties, go to it's event "on click" if that is the event you desire and then

    DoCmd.SendObject acSendReport, , "PDFFormat(*.pdf)"

    and the rest is from my previous post.

    the docmd.sendobject is the command

    acSendReport is you telling what kind of object it is - in this case a report

    and "PDFFormat(*.pdf)" is the format we want to the object sent as.Let me know if you understand.

  5. #5
    nhkhurum is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2013
    Posts
    17

    Send object

    Can you please send me screenshot of this activity. I tell you what i try.


    Open form in design veiw
    past a button {MAIL REPORT)
    Go to properties of this button and click on {event button}

    In even button i select {even procedure} and clik on ... button
    a new window open then i past the given code.

    when i apply it error msg # 2487 appear.

    plz gudie me if i do any mistake.

    Quote Originally Posted by Ruegen View Post
    ok, firstly please do not paste this code - understand it.

    In order for you to have the action of send object you require something to happen - an event.

    Each event causes something to occur.

    In our case a on the click of a button event. An OnClick() function.

    There is a properies info box that allows you to see the properties on the control of a form. A control like a button that you place on the form using the form designer.

    So create a button, open that buttons properties, go to it's event "on click" if that is the event you desire and then

    DoCmd.SendObject acSendReport, , "PDFFormat(*.pdf)"

    and the rest is from my previous post.

    the docmd.sendobject is the command

    acSendReport is you telling what kind of object it is - in this case a report

    and "PDFFormat(*.pdf)" is the format we want to the object sent as.Let me know if you understand.

  6. #6
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by nhkhurum View Post
    Can you please send me screenshot of this activity. I tell you what i try.


    Open form in design veiw
    past a button {MAIL REPORT)
    Go to properties of this button and click on {event button}

    In even button i select {even procedure} and clik on ... button
    a new window open then i past the given code.

    when i apply it error msg # 2487 appear.

    plz gudie me if i do any mistake.
    Ok. Does the form have a set of records or is just a blank form with a button on it?

    If the form is blank, you need to use the design menu and add a button.

    Because you want to customise it without using the wizard then when you add the button, you need to cancel the wizard - it will leave you with a button that does nothing.

    Then select that button in design mode and click on it's properties in the properties.

    My next question is - what is the name of your report? What have you named the report?

    In order for the button to open the report - you need to tell the docmd.sendobject what your report is.

  7. #7
    nhkhurum is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2013
    Posts
    17

    Send Object

    Plz resend me code again after adding report name as

    adjustment.


    I am beginner sorry for...
    Regards



    Quote Originally Posted by Ruegen View Post
    Ok. Does the form have a set of records or is just a blank form with a button on it?

    If the form is blank, you need to use the design menu and add a button.

    Because you want to customise it without using the wizard then when you add the button, you need to cancel the wizard - it will leave you with a button that does nothing.

    Then select that button in design mode and click on it's properties in the properties.

    My next question is - what is the name of your report? What have you named the report?

    In order for the button to open the report - you need to tell the docmd.sendobject what your report is.

  8. #8
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by nhkhurum View Post
    Plz resend me code again after adding report name as

    adjustment.


    I am beginner sorry for...
    Regards
    Try open the report first -

    docmd.openreport "adjustment"

    See if that works first.

  9. #9
    nhkhurum is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2013
    Posts
    17
    Quote Originally Posted by Ruegen View Post
    Try open the report first -

    docmd.openreport "adjustment"

    See if that works first.

    i can open report by using above command.
    File open is *.xps format

  10. #10
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by nhkhurum View Post
    i can open report by using above command.
    File open is *.xps format
    If it opens put underneath
    DoCmd.SendObject acSendReport, , "PDFFormat(*.pdf)", "the_email_here@domain.com"

  11. #11
    nhkhurum is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2013
    Posts
    17
    Quote Originally Posted by nhkhurum View Post
    i can open report by using above command.
    File open is *.xps format
    created file format is *.xps that cannot be open with pdf

  12. #12
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by nhkhurum View Post
    created file format is *.xps that cannot be open with pdf
    Correct. You don't send one format to another format.

    The report I am speaking of is an access report. It is unformatted. You format it to PDF when you use sendobject

    - why would you have the report in .xps already??

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Macro SendObject
    By buckwheat in forum Macros
    Replies: 2
    Last Post: 06-21-2013, 07:28 AM
  2. Replies: 1
    Last Post: 02-12-2013, 09:12 AM
  3. Replies: 7
    Last Post: 08-13-2012, 06:59 AM
  4. Stop SendObject Macro
    By OpsO in forum Import/Export Data
    Replies: 1
    Last Post: 08-19-2010, 09:56 AM
  5. Querry IIf Output Format (Access 2003)
    By Bruce in forum Access
    Replies: 2
    Last Post: 12-03-2009, 06:52 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums