Hi All,

Not been here for a while so not too sure if this is in the right place or not?

I am having a nightmare of an issue and I cant work out where the problem lies, I have a specific piece of bespoke software that calculates some technical data and then lays it out in Word print preview. If I run this software in Windows XP and offcie 2003 no problems, yet in Windows 7 and Word 2007 I was getting Printer error:5187, I thought this maybe to do with the format of the word templates, as it opens word but will not merge the data into it, so I then changed the bespoke software templates to match word 2007 (docx) format, this then changed the error to 'Printer error:53' It is not actually anything to do with the printer as I am only going as far as print preview. Any help would be much appreciated.

Many Thanks

Dani AI

Generated

A compact, practical diagnostic plan to isolate whether the failure is in Word/Windows (printer driver, Trust/permissions) or in the bespoke merge/automation. The hints from (trust/temp) and (printer) are useful; the steps below turn those hints into concrete tests and quick evidence-gathering.

  1. Reproduce outside the bespoke program: open the template directly in Word 2007 on the same Windows 7 machine and invoke Print Preview. Success here narrows the fault to the merge/automation path; failure points to the environment (printer/driver or Office security).
  2. Force a simple local printer driver: set the default printer to Microsoft XPS Document Writer or a basic "Generic / Text Only" driver and retry. Word uses the printer driver for layout during preview, so a missing/inaccessible network driver often causes errors.
  3. Verify Office trust and temp-file access: add the template folder to Word 2007 Trusted Locations and temporarily relax Macro/automation blocks for the test. Confirm the account running Word can read/write the temp folder (usually %TEMP% under the user profile).
  4. Check how the bespoke app runs: if it runs as a service, scheduled task or under a different account, session isolation and per-user printers can block Print Preview. Run the merge interactively under the same user session to compare.
  5. Capture the failing behaviour with a small automation test (below) and, if needed, a Process Monitor trace filtered for word.exe and the bespoke app to look for ACCESS DENIED or PATH NOT FOUND.

Use this VBScript to reproduce Word automation/PrintPreview outside the bespoke app (edit the path to the template and run as a normal user):

Set W = CreateObject("Word.Application")
W.Visible = False
On Error Resume Next
Set D = W.Documents.Open("C:\Path\To\Template.docx")
D.PrintPreview
If Err.Number <> 0 Then
  WScript.Echo "Error: " & Err.Number & " - " & Err.Description
End If
D.Close False
W.Quit

Interpretation notes: if the script/Word fails, focus on printer drivers, default-printer settings and Office updates; if the script works but the bespoke app fails, focus on how the app launches Word (account, file paths, temp file handling and any implicit network printer paths). Back up templates before changes and use the traces above to collect definitive error events.

Recommended Answers

All 2 Replies

Do you see a 'disabled' or 'blocked' macro message in the event log? I am not sure, but I find, on occasion, that documents merged from information culled in other apps seem to set off security errors in Office 2007. As I output many of my documents through CutePDF (which acts as a print-to-file), I see each of these messages on occasion. These do not occur if I import data from another Office 2007-formated file.

What are the security settings on the location(s) which hold your temp file that writes to the Word file?

To see if this is the issue, can you (in your environment) output to a doc file that is called in OpenOffice rather than Word?

Check your printers setting properly there might be some problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.