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
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