Backtrack:  
 
by lunarg on October 30th 2009, at 13:26

Since Office 2007 (and Vista), TWAIN has been kicked out in favour of WIA. As a result, it is no longer possible to use your favourite and robust TWAIN based scanner with Office 2007.
Most scanners come with the necessary software, and thus, you can circumvent the issue by using their software. However, there are various scanners - notably, office network scanners, like those on copiers, do not have such a tool. They have their driver's internal system which is callable in other software (like Office-applications). In the event that the driver is only supporting TWAIN interface for image acquisition, they do not show up in Vista's scanner list, and therefore, they cannot be used by Office 2007, the Vista scanning tool, and Paint (among others).

While there's nothing to be done to get your scanner to play nice with WIA (short of writing your own driver, or using a third party generic driver), it is possible for Office 2007 (in this case: Word 2007) to play nice with TWAIN by using a long-lost function in Office. The functionality for TWAIN is still present, but is no longer directly accessible. We can still use macros, though, which is just what we will be using.

The Insert-From-Scanner macro

Let's create a new macro for our scanner:

  1. Fire up Word 2007 and make sure you have no files open, i.e. you have an empty, unsaved document.
  2. In the Ribbon, navigate to View › Macro › View Macros › Macros in Normal.dotm and create a new macro. Give it a sensible name (like "scan").
  3. Copy paste the following code in the macro.
  4. Sub InsertFromScanner()
    	On Error Resume Next
    	WordBasic.InsertImagerScan
    End Sub
  5. When asked, save the macro, and save changes to the Normal.dotm template file. This makes sure that the macro will always be available in any documents.
  6. Try running the macro: the dialog from earlier Office versions will appear, and you should have access to your TWAIN scanner. If you don't see your scanner, the TWAIN driver is not correctly installed, or not compatible with TWAIN.
Creating a button for the Insert-From-Scanner macro

Alright, so we have our macro and can do scanning. But it would be nice to actually have a button for it.
This is perfectly possible, although you can only add buttons in the Quick Access Toolbar.

  1. In the Quick Access Toolbar, click on the arrow at the end, and choose Customize.
  2. Choose as command from Macros, then Add. Modify the button to give it a distinctive icon; choose one to your liking, though.
  3. The button will be added, and you can use it to call your macro, and subsequently, the Insert-From-Scanner dialog.
Optionally: network deployment

If you have a whole bunch of computers on the same network scanner, you may want to copy the settings, rather than performing them each time on each computer.

  1. Find the default template normal.dotm. By default, it should reside in:
    %HOMEDRIVE%%HOMEPATH%\Application Data\Microsoft\Templates\normal.dotm
    It contains the Insert-From-Scanner macro that calls the scanner dialog.
  2. Create two copies of the file. Keep one with the default name (normal.dotm), and another copy with name scanning.dotm. Place these files on a network share where everyone has read-only access.
  3. The Quick Access toolbar is also stored in a file, called Word.qat. Its default location is:
    %HOMEDRIVE%%HOMEPATH%\Local Settings\Application Data\Microsoft\Office\Word.qat
    Copy this file to the network share as well.
  4. You should now have three files. Next up, create a way for these files to find its way to your user's profile. For instance, you can use a batch file. If you're in a domain, you can use it inside a logonscript, optionally applied by a GPO.
  5. ren "%HOMEDRIVE%%HOMEPATH%\Application Data\Microsoft\Templates\normal.dotm" normal.orig
    copy /-Y normal.dotm "%HOMEDRIVE%%HOMEPATH%\Application Data\Microsoft\Templates"
    
    copy /-Y scanning.dotm "%HOMEDRIVE%%HOMEPATH%\Application Data\Microsoft\Word\STARTUP"
    
    ren "%HOMEDRIVE%%HOMEPATH%\Local Settings\Application Data\Microsoft\Office\Word.qat" Word.orig
    copy /-Y Word.qat "%HOMEDRIVE%%HOMEPATH%\Local Settings\Application Data\Microsoft\Office"

    Note that copying these files will overwrite the normal.dotm template and Quick Access toolbar settings.

Original post: http://help.lockergnome.com/vista/ning-word-2007--ftopict68179.html
Tested by myself at a client with these problems.

 
 
« December 2024»
SunMonTueWedThuFriSat
1234567
891011121314
15161718192021
22232425262728
293031    
 
Links
 
Quote
« When a bird does poo poo in your eye, be happy elephants don't fly. »