Scanning a document automatically

philfloyduk

Board Regular
Joined
Jan 6, 2011
Messages
82
Hi.

I'm currently using some code that opens word from excel (within a userform), scans an image and saves the file, then closes word when it's done. In an ideal world word wouldn't have to be used, is there another way around it? Failing that, is there a way to make it scan automatically because as it stands the user has to click in to word and select 'insert'. Is there code that will get it to do the insert part automatically?

Here is the code I am using:

Dim oApp As Object
Dim oWord As Object
Set oApp = CreateObject("Word.Application")

Set oWord = oApp.Documents.Add()
oApp.Visible = True
oApp.WordBasic.InsertImagerScan
Dim finalRptName As String
finalRptName = numberTextBox.Value + " " + roadTextBox.Value + " (" + idTextBox.Value + ")" + ".doc"
oWord.SaveAs ("C:\Users\WIN 7\Dropbox\Rental contracts\" & finalRptName)
oApp.Quit

Also, saving the file as a PDF would be a great help because the user could then view the file from within the UserForm using AcroPDF viewer.

Thanks in advance for any help offered


Phil
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,224,586
Messages
6,179,712
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top