Convert pdf files to word via VBA based on 2 conditions

Iron Contributor

I would like to convert pdf files to text using the dir function based on 2 criteria:

 

1. file string would need to include "T16GB0004K"

2. file dated should be within 3 months of Today's date

 

The code below was popping out an error, therefore how should i go about this?

 

Dim FolderPath as String

FolderPath = "C:\Users\hrhquek\Desktop\Past OPPTY"

path = FolderPath & "\*.pdf" & "T16GB0004K*"

 

 

1 Reply
Try

path = FolderPath & "\*.pdf"
If instr(path, "T16GB0004K") > 0 Then
' Balance of your code
End If