Compartir a través de

INSERTAR DESDES ESCANER EN WORD 2013

Anónimas
2013-11-05T14:49:59+00:00

Saludos a todos los usuarios de la comunidad de Office

Por favor. Me gustaría poder insertar desde un escáner directamente en WORD 2013.

Si se hace mediante una macro. Necesito que me lo expliquen paso a paso.

Desde la pestaña Programador como creo la MACRO. ¿Qué comandos tengo que poner?

Que debo de tener activado y como debo activarlo.

GRACIAS POR VUESTRA AYUDA.

Microsoft 365 y Office | Word | Para la casa | Windows

Pregunta bloqueada. Esta pregunta se migró desde la Comunidad de Soporte técnico de Microsoft. Puede votar si es útil, pero no puede agregar comentarios o respuestas ni seguir la pregunta.

0 comentarios No hay comentarios

6 respuestas

Ordenar por: Muy útil
  1. Anónimas
    2014-10-20T17:36:43+00:00

    yo había hecho la misma modificación.... pero sigue sin funcionar.. se me abre la ventada de ejecutar la macro, pero no realiza ninguna acción

    ¿Le ha resultado útil esta respuesta?

    1 persona ha encontrado útil esta respuesta.
    0 comentarios No hay comentarios
  2. Anónimas
    2014-12-20T18:50:11+00:00

    el codigo antes descrito, me hace lo mismo, se ejecuta y no pasa nada, encontre este otro codigo, que se ejecuta pero me da error en una linea, y me dice que no encontro ningun dispositovo WIA del tipo seleccionado, estoy tratando de usar un escaner en red, con una canon iR2200, en office 2010 se ejecutaba sin **** con otro codigo del mismo autor.

    Option Explicit

    Public Declare Function SHGetSpecialFolderLocation _

    Lib "shell32" (ByVal hwnd As Long, _

    ByVal nFolder As Long, ppidl As Long) As Long

    Public Declare Function SHGetPathFromIDList _

    Lib "shell32" Alias "SHGetPathFromIDListA" _

    (ByVal pidl As Long, ByVal pszPath As String) As Long

    Public Declare Sub CoTaskMemFree Lib "ole32" (ByVal pvoid As Long)

    Public Const CSIDL_LOCAL_APPDATA = &H1C '<user name>\Local Settings\Application Data

    Public Const MAX_PATH = 260

    Public Const NOERROR = 0

    Public Function TempFolder(ByVal lngFolder As Long) As String

    Dim lngPidlFound As Long

    Dim lngFolderFound As Long

    Dim lngPidl As Long

    Dim strPath As String

    strPath = Space(MAX_PATH)

    lngPidlFound = SHGetSpecialFolderLocation(0, lngFolder, lngPidl)

    If lngPidlFound = NOERROR Then

    lngFolderFound = SHGetPathFromIDList(lngPidl, strPath)

    If lngFolderFound Then

    TempFolder = Left$(strPath, _

    InStr(1, strPath, vbNullChar) - 1)

    End If

    End If

    CoTaskMemFree lngPidl

    End Function

    Sub Scan()

    'Based on a macro by Günter Born www.borncity.de blog.borncity.com

    'Requires a reference to Microsoft Windows Image Acquisition Object Library

    ' On Error Resume Next

    Dim objCommonDialog As WIA.CommonDialog

    Dim objImage As WIA.ImageFile

    Dim strPath As String

    Set objCommonDialog = New WIA.CommonDialog

    Set objImage = objCommonDialog.ShowAcquireImage

    strPath = SpecFolder(&H1C) & "\Temp\TempScan.jpg" ' set temporary file location

    If Not objImage Is Nothing Then

    objImage.SaveFile strPath ' save into temporary file

    'Insertion alternatives ++++++++++++++

    Selection.InlineShapes.AddPicture strPath ' Insert in Word Document

    'ActiveSheet.Pictures.Insert(strPath).Select 'Insert in Excel

    'If TypeName(ActiveWindow) = "Inspector" Then 'Insert into Outlook message

    ' If ActiveInspector.IsWordMail And ActiveInspector.EditorType = olEditorWord Then

    ' ActiveInspector.WordEditor.Application.Selection.InlineShapes.AddPicture strPath

    ' End If

    'End If

    '+++++++++++++++++++++++++++++++++++++

    Set objImage = Nothing

    End If

    If Not Dir(strPath) = vbNullString Then Kill strPath 'Remove the temporary file

    Set objCommonDialog = Nothing

    End Sub

    Public Function SpecFolder(ByVal lngFolder As Long) As String

    Dim lngPidlFound As Long

    Dim lngFolderFound As Long

    Dim lngPidl As Long

    Dim strPath As String

    strPath = Space(MAX_PATH)

    lngPidlFound = SHGetSpecialFolderLocation(0, lngFolder, lngPidl)

    If lngPidlFound = NOERROR Then

    lngFolderFound = SHGetPathFromIDList(lngPidl, strPath)

    If lngFolderFound Then

    SpecFolder = Left$(strPath, _

    InStr(1, strPath, vbNullChar) - 1)

    End If

    End If

    CoTaskMemFree lngPidl

    End Function

    cuando la ejecuto me lanza esta ventana

    el error lo marca en esta linea

    Set objImage = objCommonDialog.ShowAcquireImag

    esta es la web del autor 

    http://www.gmayor.com/scan\_into\_word\_2007.htm

    ¿Le ha resultado útil esta respuesta?

    0 comentarios No hay comentarios
  3. Anónimas
    2014-05-07T19:12:31+00:00

    He realizado estos pasos y la macro aqui descrita funciona.

    Las lineas que aparecen en rojo tienen error debido a que al copiar y pegar no se pega correctamente la comilla simple, el cual debe corregirse linea por linea, ya que el lenguaje interpreta que todo despues de la comilla simple es un comentario. 

    Const MaxPathLen = 256 ‘ Max path length

    Lo correcto es:

    Const MaxPathLen = 256 ' Max path length

    “kernel32?

    Deben ser comillas

    "kernel32"

    “GetTempPathA”

    "GetTempPathA"

    TempPath = Left(FolderName, InStr(FolderName, Chr(0)) - 1)

    Esta es otra linea que me devolvia error. Al copiar y pegar algo queda mal, lo que hice fué cambiar el simbolo de resta (-) que se encuentra al final     ) - 1) 

    Aqui pego tal y como me quedó, pero puede cambiar al momento de guardarse este comentario

    ' Scan for Word 2013

    ' Author: Günter Born www.borncity.de blog.borncity.com

    ' Implements a Scan function in Word 2013

    Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long

    Private Function TempPath() As String

    Const MaxPathLen = 256 ' Max path length

    Dim FolderName As String ' Folder name

    Dim ReturnVar As Long ' Return Value

    FolderName = String(MaxPathLen, 0)

    ReturnVar = GetTempPath(MaxPathLen, FolderName)

    If ReturnVar <> 0 Then

       TempPath = Left(FolderName, InStr(FolderName, Chr(0)) - 1)

    Else

       TempPath = vbNullString

    End If

    End Function

    Sub Escaneo()

    '

    ' Scan Macro, to be invoked in Word

    '

    On Error Resume Next

    Dim objCommonDialog As WIA.CommonDialog

    Dim objImage As WIA.ImageFile

    Dim strDateiname

    ' instantiate Scan WIA objects

    Set objCommonDialog = New WIA.CommonDialog

    Set objImage = objCommonDialog.ShowAcquireImage

    strDateiname = TempPath & "Scan.jpg" ' set temporary file

    If Not objImage Is Nothing Then

       Kill strDateiname

       objImage.SaveFile strDateiname ' save into temp file

       Selection.InlineShapes.AddPicture strDateiname ' insert in doc

       Set objImage = Nothing

    End If

    Set objCommonDialog = Nothing

    ' MsgBox strDateiname  ' test output

    End Sub

    Espero que a alguien le sirva.

    Ojo.  Solo el nombre de la macro cambié por ESCANEO

    ¿Le ha resultado útil esta respuesta?

    0 comentarios No hay comentarios
  4. Anónimas
    2013-11-15T12:33:16+00:00

    es bastante complicado. Con lo fácil que era trabajar en Word 2007, donde si pude hacerlo con una macro. Y trabajar a nivel doméstico,  con mí multifunción Samsung.

    Cuando inserto las líneas de comando me indica que no se ha definido sub o funtion. Lo señala en amarillo.

    he copiado directamente el texto como lo define la página web. pero sigo teniendo problemas.

    La otra solución es de pago. La he instalado y luego eliminado. No me funcionaba. No lo veo correcto después de haber pagado tanto por la licencia del paquete office.

    Si lo entiendo bien. Hay que activar dentro de Programador, Herramientas, Referencias M W imagen Adquisición librería 2.0. además veo que aparecen otras librerías referidas a mí escáner Samsung y a programa. (yo lo he activado por último, a ver si funcionaba. Pero no).

    Creo la Macro con el nombre Escaner o Scan.

    Introduzco el texto:

    Private Function TempPath() As String

     Const MaxPathLen = 256 ‘ Max path length

     Dim FolderName As String ‘ Folder name

     Dim ReturnVar As Long ‘ Return Value

     FolderName = String(MaxPathLen, 0)

     ReturnVar = GetTempPath(MaxPathLen, FolderName)

     If ReturnVar <> 0 Then

     TempPath = Left(FolderName, InStr(FolderName, Chr(0)) – 1)

     Else

     TempPath = vbNullString

     End If

     End Function

    Sub Scan()

     ‘ Scan Macro, to be invoked in Word

    On Error Resume Next

     Dim objCommonDialog As WIA.CommonDialog

     Dim objImage As WIA.ImageFile

     Dim strDateiname

    ‘ instantiate Scan WIA objects

     Set objCommonDialog = New WIA.CommonDialog

     Set objImage = objCommonDialog.ShowAcquireImage

     strDateiname = TempPath & “Scan.jpg” ‘ set temporary file

     If Not objImage Is Nothing Then

     Kill strDateiname

     objImage.SaveFile strDateiname ‘ save into temp file

     Selection.InlineShapes.AddPicture strDateiname ‘ insert in doc

     Set objImage = Nothing

     End If

     Set objCommonDialog = Nothing

    ‘ MsgBox strDateiname  ‘ test output

     End Sub

    Si falta algún comando más. No lo sé.

    No se si es correcto la posición de las comas.  Algunos párrafos se ponen en rojo.

    Si podéis ayudarme. Os lo agradecería.

    GRACIAS A TODOS

    Y EN ESPECIAL A LA PERSONA QUE ME RESPONDIO.

    ¿Le ha resultado útil esta respuesta?

    0 comentarios No hay comentarios
  5. Anónimas
    2013-11-11T20:50:56+00:00

    Hola Juan,

    La información que te necesitas lamentablemente no esta en español, pero si entiendes ingles es muy fácil te incluyo dos enlaces para poder ayudarte,

    http://www.borncity.com/blog/2013/02/04/scanning-in-word-2013/

    https://www.scanintooffice.com/Features/OneClickScanning.aspx

    Saludos.

    ¿Le ha resultado útil esta respuesta?

    0 comentarios No hay comentarios