Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2007

Tip: Looking for answers? Try searching our database.

Word 2007 VBA can not set options.print... properties

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dmitri Karpov - 01 Feb 2007 22:35 GMT
Has anyone else run into this (and found a reason/fix)?
On one of our five test dev machines, Word 2007 has a weird bug.
Start a blank new doc, go into the VBA macro editing area, add the
line:
options.printbackground=false
(on our machine, you can use ANY of the print options for this test -
printcomments, printbackgrounds, printdraft, etc.). they ALL fail...
but the non-print options are fine.)

If I try to run the macro, it breaks on that line with a runtime 4120
error bad parameter.
I've changed it to options.printbackground=true - still no go.
I've tried changing the default printer and restarting word. Still no
go.

Curiously, I can do a:
msgbox options.printbackground
and it will accurately read the value of the printbackground hckecbox
from the word options, advanced, printing section.

so... on this ONE machine, I can READ but not SET the options for
printing programmatically.

Any ideas??? Corrupt install??? Read only xml ini file or some other
obscure weirdness????
Regards.
MikeG - 01 Mar 2007 11:15 GMT
Hi Dmitri

I've got exactly the same problem on one of our test PCs.
As with you I can read the "options.UpdateFieldsAtPrint" setting but can not
change it without getting the "error 4120 bad parameter".
The same macro runs fine on various other machines using Word 2007.  
The only difference I can find with the faulty machine is that it is running
Office 2007 Home and Student (on WinXP) where as the others are running
"full" versions of Office 2007 on either XP or Vista.
What version of Office are you getting the problem with?

> Has anyone else run into this (and found a reason/fix)?
> On one of our five test dev machines, Word 2007 has a weird bug.
[quoted text clipped - 22 lines]
> obscure weirdness????
> Regards.
Mary Mc - 21 Mar 2007 20:39 GMT
I, too, have the same problem at one of my clients' offices.  Windows XP
Professional, Version 2002, Service Pack 2 and Word 2007 (12.0.4518.1014) MSO
(12.0.4518.1014).

Can't set any of the Options.
       .UpdateFieldsAtPrint = True
       .UpdateLinksAtPrint = False
       .DefaultTray = "Use printer settings"
       .PrintBackground = True
       .PrintProperties = True
       .PrintFieldCodes = True
       .PrintComments = True
       .PrintHiddenText = True
       .PrintDrawingObjects = True
       .PrintDraft = False
       .PrintReverse = False
       .MapPaperSize = True
Get the same error 4120, bad parameter.
I only care about three of them but they all fail.  
Signature

Mary Mc

> Hi Dmitri
>
[quoted text clipped - 33 lines]
> > obscure weirdness????
> > Regards.
Mike Borozdin - 28 Mar 2007 02:04 GMT
We have hit the same issue.  Interestingly enough Word 2007 on Vista works
fine and the same interop code works fine on Word 2003/XPSP2.

We are using .NET interop to print word documents in the background.

I am curious if there is a diagnostic dump of an office installation that
can help us compare the installation.

> Has anyone else run into this (and found a reason/fix)?
> On one of our five test dev machines, Word 2007 has a weird bug.
[quoted text clipped - 22 lines]
> obscure weirdness????
> Regards.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.