|
-
Dec 27th, 2004, 03:16 PM
#1
Thread Starter
Member
VB - Scanning Acrobat from VB Application
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
-
Dec 31st, 2004, 01:54 PM
#2
Re: VB - Scanning Acrobat from VB Application
Just a note: This wil only work for Full versions of Acrobat.
Also, will this work for 5 & 6?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 3rd, 2005, 09:09 AM
#3
Thread Starter
Member
Re: VB - Scanning Acrobat from VB Application
I know this works with Adobe Acrobat 5.0 with Fujitsu 15c TWAIN scanner since I have tried it. I don't have Adobe 6.0 but it should work with Adobe 6.0.
-
Jan 19th, 2005, 09:26 AM
#4
New Member
Re: VB - Scanning Acrobat from VB Application
What is meant by Full Versions of Adobe???
I have the Full version of Acrobat Standard 6.0 and this code does not seem to be working?
Thanks,
Rog
-
Jan 19th, 2005, 09:38 AM
#5
Thread Starter
Member
Re: VB - Scanning Acrobat from VB Application
Rogo:
What seems to be the problem? Also, the scanner you are using, is it a TWAIN compatible?
-
Jan 19th, 2005, 01:25 PM
#6
New Member
Re: VB - Scanning Acrobat from VB Application
The problem is the following.....
I have Acrobat 6.0.3 Standard. When running this code I get an error of invalid file.
Adobe does not come up nor does the scanner software come up either.
I do have a scanner plugged in and turned on. The scanner works well with Photoshop and word.
I have traced the code and basically I am getting to the
If AvDoc.IsValid Then
Here it fails.
I did look into the Adobe Acrobat program and cannot for the life of me see any menu item that allows a scan to document?
I have looked on the Adobe site and belive that I can, but don't know how.
Thanks,
Rog
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|