Results 1 to 2 of 2
  1. #1
    Stan Denman is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    50

    Export data to PDF Form

    I am halfway to what I need to accomplish with this code I found on the internet:
    Private Sub Command80_Click()




    Dim WshShell As Object

    Set WshShell = CreateObject("Wscript.Shell")

    WshShell.Run "Acrobat.exe E:\ssa1693.pdf"


    ' delay to let the form load completely
    PauseTime = 1
    Start = Timer
    Do While Timer < Start + PauseTime
    DoEvents
    Loop

    Set App = CreateObject("Acroexch.app")
    Set avDoc = CreateObject("AcroExch.AVDoc")
    Set avDoc = App.GetActiveDoc
    Set pdDoc = avDoc.GetPDDoc
    Set jso = pdDoc.GetJSObject


    ' let's clear the form
    temp = jso.resetForm()

    ' populate a couple fields
    Set x = jso.getField("ClientSSN")
    x.Value = Me.SSN.Value

    Set x = jso.getField("ClientFirstName")
    x.Value = Me.FirstName.Value

    Set x = jso.getField("LasteName")
    x.Value = Me.LastName

    Set x = jso.getField("ClientFirstName")
    x.Value = Me.FirstName.Value



    'housekeeping on the way out
    Set App = Nothing
    Set avDoc = Nothing
    Set pdDoc = Nothing
    Set jso = Nothing


    End Sub

    So this code sets my values in the pdf form nicely but I would like it to do a little more. Sorry I am a rank amatuer so by gentle. I want to save the newly populated form as "ClientFirstName""ClientLastName"SSA1693 AND I want it saved to my Office 365 oneDrive, AND I want it automatically sent to my client at their email address that is sitting on the microsoft access form. Any ideas? Thanks s much in advance!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Please post code between CODE tags to retain indentation and readability.

    I have code that simply saves PDF object.
    Code:
    strPath = "R:\Projects\LabReportsOLD\" & rs!StateNum & "\Concrete Mix Design\" & rs!Labnum & ".pdf"
    pdfDoc2.Save 1, strPath
    In your case, build strPath value by concatenating string with form controls. Sorry, know nothing about saving to OneDrive. Do you have drive mapping on your computer to OneDrive?

    Use Outlook automation to attach PDF file.
    https://www.accessforums.net/showthread.php?t=64924

    Should have Option Explicit at top of every code module and explicitly declare all variables. https://www.fmsinc.com/MicrosoftAcce...ons/index.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 26
    Last Post: 04-07-2020, 02:29 AM
  2. Export to excel from data in Form
    By Kirana in forum Import/Export Data
    Replies: 4
    Last Post: 05-02-2017, 11:16 PM
  3. export form data to excel
    By slimjen in forum Forms
    Replies: 4
    Last Post: 07-01-2015, 02:09 PM
  4. Export Form And Subform Data To Excel Form Same Worksheet
    By tomtheappraiser in forum Import/Export Data
    Replies: 6
    Last Post: 08-12-2013, 10:39 AM
  5. Export a form data with attachment
    By Gloring in forum Import/Export Data
    Replies: 1
    Last Post: 07-02-2012, 03:00 PM

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