Full Version: Export To Fillable Pdf?
UtterAccess Discussion Forums > Microsoft® Access > Access Automation
SpyderXLT
Access Gurus,

Firstly, I'd like to share this bit of code that exports data from an Access form to an Excel spreadsheet. Works great.

------------------------------------------------------------------------------------
Private Sub Command31_Click()
' Microsoft Excel 11.0 Object Library

Dim appExcel As Excel.Application
Dim wbook As Excel.Workbook
Dim wsheet As Excel.Worksheet
Dim strFilter As String
Dim strInputFileName As String
Dim LResponse As Integer

LResponse = MsgBox("You Must Use The Copy Of The Electronic DAR Distributed With DEP 2012. Click OK To Proceed To The File Browser And Select The 2012 E-DAR.xls File.", vbOK, "WARNING")
If LResponse = vbOK Then

LResponse = MsgBox("When The E-DAR File Opens, You Will Be Prompted To Update Data Sources. Select 'Don't Update' To Continue", vbOK, "WARNING")
If LResponse = vbOK Then

strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.xlsx)", "*.xlsx")
strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.xlsx)", "*xlsx")
strInputFileName = ahtCommonFileOpenSave(InitialDir:=CurrentProject.path, _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please Select The Electronic DAR.xlsx file Included With DEP 2011.", _
Flags:=ahtOFN_HIDEREADONLY)

If Len(strInputFileName) > 0 Then
Set appExcel = New Excel.Application
appExcel.Visible = True
Set wbook = appExcel.Workbooks.Open(strInputFileName)
Set wsheet = wbook.Worksheets("DAR")
With wsheet
.Range("D25").value = [Text424]
.Range("AH25").value = [Text390]
.Range("D27").value = [Text391]
.Range("J27").value = [Text392]
.Range("V25").value = [Text425]
.Range("S27").value = [Text393]
.Range("AD27").value = [Text394]
.Range("F29").value = [Text395]
.Range("X29").value = [Text396]
.Range("AU2").value = [Text397]
.Range("AV2").value = [Text398]
.Range("T31").value = [Text399]
.Range("AM2").value = [Text403]
.Range("AN2").value = [Text404]
.Range("AO2").value = [Text405]
.Range("AP2").value = [Text406]
.Range("AQ2").value = [Text407]
.Range("AR2").value = [Text408]
.Range("AS2").value = [Text409]
.Range("AT2").value = [Text410]
.Range("A36").value = [Text53]
.Range("AH31").value = [Text412]
.Range("L3").value = [Text418]
.Range("Q5").value = [Text420]
.Range("AC33").value = [Text421]
.Range("E33").value = [Text422]
.Range("P29").value = [Text423]
.Range("A41").value = [RecName]
.Range("T41").value = [RinCName]
.Range("N41").value = [DateNow]
.Range("AG41").value = [DateNow]
.Range("A36").value = [Text53]
End With
End If
End If
End If
End Sub

------------------------------------------------------------------------------------

Secondly, I'm trying to get away from using the Excel version of this 'form' and would like to switch to a fillable PDF 'form' (already on hand) so that it can be digitally signed. Any ideas?

-SpyderXLT
ToddW
Do you have the Adobe Acrobat Professional installed? If so, I think you could set a reference to the Adobe Acrobat x.x Type library file and use the PDDOM object to search through it. Haven't done it myself.

Or you could try using the shell, appactivate, and sendkeys command if it's possible to go to all the fields and fill them all out using only the keyboard- but this may not be very reliable (but would be pretty easy to try out).
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.