Results 1 to 3 of 3

Thread: How to use VBA code in VB for Insert Picture from Scanner Command?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    65

    Red face How to use VBA code in VB for Insert Picture from Scanner Command?

    I am trying to use the menu item from MS Word 2003:

    Insert > Picture > From Scanner or Camera

    I would like to be able to pull up this dialog box through a code using a Visual Basic .NET application. I recorded a macro and got the following syntax when using the menu item:

    VB Code:
    1. WordBasic.InsertImagerScan()

    However, the Visual Studio IDE complains that "Name 'WordBasic is not declared". I am coding this in Visual Basic because I am creating a that uses the new Visual Studio Tools for Office application.

    If for some reason this command is not supported in VBA, is there an easy way to use sendkeys?

    Any help would be appreciated.

    Thanks,
    Brian

  2. #2
    New Member
    Join Date
    Oct 2007
    Posts
    1

    Re: How to use VBA code in VB for Insert Picture from Scanner Command?

    I am trying to accomplish the same thing using Excel 2003. Any help out there?

    Thanks in advance!

  3. #3
    New Member
    Join Date
    Sep 2008
    Posts
    1

    Re: How to use VBA code in VB for Insert Picture from Scanner Command?

    Users..

    I had the problem but worked it out with xp plus access and word 2003

    Works sweet

    You can use it to open a document or open a new document.

    It will open word,start the scanner camera wizard from xp

    All you do is to click on the “insert” button on the below form

    It will open your document and then insert the scanned document.

    It will then save the new document as you define below.

    It will then close the wizard and ms word 2003

    Hope this helps you and others..

    Send it to whoever has this problem

    Joe archer sr

    San diego ca











    Private Sub Command779_Click()

    On Error GoTo Err_Command779_Click



    Dim oApp As Object

    Dim oWord As Object

    Set oApp = CreateObject("Word.Application")

    'Set oWord = oApp.Documents.Open(FileName:="C:\Wreck Check PDF Documents\Assessment_Scanned_Info.doc") ' TO OPEN specific word document

    Set oWord = oApp.Documents.Add()

    oApp.Visible = True

    oApp.WordBasic.InsertImagerScan ' WILL OPEN SCANNER camera WIZARD, JUST CLICK ON "insert" button

    Dim finalRptName As String

    finalRptName = "Assessment No" & " " & Me.Combo548 & ".DOC"

    oWord.SaveAs ("C:\Wreck Check PDF Documents\_Scanned_Info" & finalRptName) 'PATH AND NAME OF .DOC YOUR WANT



    oApp.Quit ' WILL CLOSE THE WORD DOCUMENT AND WORD AND RETURN YOU TO ACCESS FORM



    Exit_Command779_Click:

    Exit Sub



    Err_Command779_Click:

    MsgBox Err.Description

    Resume Exit_Command779_Click



    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width