Results 1 to 4 of 4
  1. #1
    JanJau is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2015
    Posts
    2

    Generate encryption file

    I can generate a PDF format file but i want to be encrypted to be sent to email attachement. Is there anyway to generate encrypted file in Access?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Do you mean password protection?

    VBA code can create an Excel workbook and set password protection. VBA code can also manipulate PDF file so I am guessing could set password.
    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.

  3. #3
    JanJau is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2015
    Posts
    2
    Yes, password protection. Is ther any link how to do it. I can generate the PDF file but i don't know how to manipulate to set a password. I appreciate your help.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    I don't know a specific source for code. I learned how to manipulate PDF as an object in VBA by searching web for code. I don't have those web links.

    Here is excerpt from my code:

    Code:
    Dim pdfDoc As Acrobat.AcroPDDoc
    Set pdfDoc = New Acrobat.AcroPDDoc
    rs.Open "SELECT * FROM PDFpage2error ORDER BY StateNum, Item;", CurrentProject.Connection, adOpenDynamic, adLockPessimistic
    While Not rs.EOF
        strPath = "R:\Projects\LabReportsTemp\" & rs!StateNum & "\" & rs!MatType & _
                    IIf(rs!MatType Like "Soils*", "\ItemGroup" & rs!ItemGroup, "") & "\" & rs!LABNUM & ".pdf"
        If Dir(strPath) <> "" Then
            pdfDoc.Open strPath
            pdfDoc.DeletePages 1, 1 'page index is 0 based
            pdfDoc.Save 1, strPath
            pdfDoc.Close
        End If
        rs.MoveNext
    Wend
    This requires setting VBA reference to Adobe Acrobat 10.0 Type Library.

    Whether or not code can set properties (such as password) of PDF file, I can't say - never explored that.
    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. Password field encryption
    By bakkouz in forum Database Design
    Replies: 3
    Last Post: 10-10-2011, 07:15 AM
  2. OLE Db Encryption error
    By lkmaurik in forum Programming
    Replies: 1
    Last Post: 05-23-2011, 04:01 AM
  3. Replies: 1
    Last Post: 05-16-2011, 01:34 PM
  4. Link Excel file to MS Access and generate rep
    By Priceless in forum Import/Export Data
    Replies: 14
    Last Post: 02-21-2011, 02:08 PM
  5. Can a report execute generate a file
    By techexpressinc in forum Reports
    Replies: 7
    Last Post: 01-16-2010, 04:03 AM

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