Can a PDF File's Protected View be Removed with VBA Code

I have some VBA Code in MS Access that grabs a PDF from an email in Outlook.  When I open these PDFs they show that they are in "Protected View" mode.   Next to this message is a "Enable All Features" button that removes the protection.

My VBA code loops through the PDF document and grabs the text from each field and then puts it in a table in Access.  Because the PDFs are protected, it's unable to grab any of the text from the PDF.

Is there a way with VBA Code to remove the "Protected View" mode from the PDFs once it is open, and prior to my VBA Code running?

Here is my VBA code:
Function GetFileText(strFilePath As String) As String
'IAC objects
Dim gPdDoc As Acrobat.CAcroPDDoc
Dim gAvDoc As Acrobat.CAcroAVDoc

'Dim gPDFPath As String
Dim sName As String
Dim lNum As Integer

'Initialize Acrobat by creating App object
Set gApp = CreateObject("AcroExch.App")

'Set AVDoc object
'gAvDoc = gApp.GetActiveDoc
Set gAvDoc = CreateObject("AcroExch.AVDoc")

' open the PDF
If gAvDoc.Open(strFilePath, "") Then
    'Set PDDoc object and get some data
    Set gPdDoc = gAvDoc.GetPDDoc
    lNum = gPdDoc.GetNumPages
    sName = gPdDoc.GetFileName
    GetFileText = Acro_GetPageText(strFilePath, gPdDoc, gAvDoc)
End If

End Function

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jeffrey CoachmanMIS LiasonCommented:
I don't think VBA can manipulate a PDF to that level...

If it could, then "protected" would not mean much...

But lets see what other experts may suggest.
gdunn59Author Commented:
Jeffrey Coachman,

That's what I was wondering.

Jeffrey CoachmanMIS LiasonCommented:
oK, ...lets see if another Expert may have a suggestion
5 Ways Acronis Skyrockets Your Data Protection

Risks to data security are risks to business continuity. Businesses need to know what these risks look like – and where they can turn for help.
Check our newest E-Book and learn how you can differentiate your data protection business with advanced cloud solutions Acronis delivers

John TsioumprisSoftware & Systems EngineerCommented:
You could bypass it by using some of the utilities that are circulating in the Internet and calling it by Access..unlock the PDF and repeat the process..i have found this post here that you could utilize with some tweaking.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gdunn59Author Commented:

I noticed that the software in your post is available for download.  Only problem, our company doesn't allow us to download anything.

I've also got the IT people here at work looking into why it isn't working now, because it wasn't an issue prior to upgrading to Windows 10 and MS Access 2016.  These PDF documents were protected before also, but it worked.

John TsioumprisSoftware & Systems EngineerCommented:
Trying to bypass limitations without using extra tools is near impossible
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.