Shading a Form Field using code

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Shading a Form Field using code

Post by ABabeNChrist »

I have a document that is loaded with form fields, when the shading is on, they are much easier to see. I was thinking of adding a toggle switch to my already exisiting custom tool bar ribbon. The main reason for removing the shading is because of the printing factor.
When I recorded this action (macro) while using Office 2007, this is the line of code I received within the macro.

Code: Select all

    ActiveDocument.FormFields.Shaded = Not ActiveDocument.FormFields.Shaded
I would much perfer to have the shading removed if shadded during printing and then return after print cycle

User avatar
HansV
Administrator
Posts: 78558
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Shading a Form Field using code

Post by HansV »

To turn field shading off, use

ActiveDocument.FormFields.Shaded = False

and to turn it on, use

ActiveDocument.FormFields.Shaded = True

But are you sure that field shading is printed if it is displayed on the screen?
Best wishes,
Hans

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Shading a Form Field using code

Post by ABabeNChrist »

Thank you Hans
You are so right again, I was only using print preview, from there it shows the shading, so I took it as there were going to print. I printed a page and you are so right they did not print, so this whole concern about shading is now dust in the wind and that’s a good thing

User avatar
HansV
Administrator
Posts: 78558
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Shading a Form Field using code

Post by HansV »

As you have found, print preview is not always accurate, unfortunately. It would have been better if print preview displayed the document exactly as it would be printed...
Best wishes,
Hans

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: Shading a Form Field using code

Post by ABabeNChrist »

You would think so since they gave it a name of “PRINT PREVIEW” , it can be deceiving
They should called it “PRINT ALMOST PREVIEW”
:laugh: