This is a sample code that shows how to scan documents in adobe and save them from a VB application.
VB Code:
Sub ScanFile() Dim adobe As CAcroApp Dim ok As Integer Dim pdDoc As CAcroPDDoc Dim AvDoc As CAcroAVDoc Dim pdffile As String Set adobe = CreateObject("AcroExch.app") 'Set AvDoc = CreateObject("AcroExch.avdoc") pdffile = "C:\temp.pdf" ok = adobe.MenuItemExecute("Scan") Set AvDoc = adobe.GetActiveDoc If AvDoc.IsValid Then Set pdDoc = AvDoc.GetPDDoc If pdDoc.Save(1, pdffile) <> True Then MsgBox ("Failed to save " & pdffile) End If pdDoc.Close Else MsgBox ("Invalid file") End If AvDoc.Close (0) adobe.Exit End Sub




Reply With Quote