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 / December 2006

Tip: Looking for answers? Try searching our database.

Macro to change background color

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KC Rippstein - 05 Dec 2006 19:02 GMT
Hello!
I have a sensitive Word document that I am trying to put some controls on.
- First, I require a password to even open the file.
- Then another dialog box requires another password to edit the file or you
are forced to open as read-only.
- Finally, I created a macro that disables printing automatically upon
opening, but there's a catch...the user can simply disable macros or hold
down the shift key when opening the file.

So, here's my thought.  What I'd like to do is set the background of the
entire document and all tables to black and create a macro that changes all
of it back to white.  Only my header rows in each table have a different
color, all else is white.  Since the doc is protected, they cannot manually
change it and will be forced to re-open the document and accept my macro.
This is for internal use only, so the trust factor will not be an issue.

Can you help me write a simple VBA code that changes the background of the
entire body and all tables to white again?  I see an example in the forum
for changing all tables to a color, but that example does not alter the
actual document background, too.  I also need to incorporate the password
into it to allow formatting change and then set the protection back on
again, and I need it to keep the color of table header rows correct.

And I am not worried about them using Alt+PrintScreen, as most folks are not
familiar with that.  The main thing we want to accomplish is prevent anyone
from accidentally sending this to someone or leaving a printed copy on their
desk.

Thanks so much!  I use advice from these forums every day...you are all
fantastic!
- KC Rippstein
Greg Maxey - 05 Dec 2006 20:18 GMT
Perhaps something like
If ActiveDocument.Background.Fill.Visible = True Then
 ActiveDocument.Background.Fill.Visible = False
End If

This approach seems rather convoluted.

Perhaps the national repository at Fort Knox is better suited for this
document ;-)

> Hello!
> I have a sensitive Word document that I am trying to put some controls on.
[quoted text clipped - 27 lines]
> fantastic!
> - KC Rippstein
KC Rippstein - 05 Dec 2006 21:36 GMT
Many thanks.  That meets my needs perfectly.  I put that in the document
open macro and put its reverse in the document close followed by a save
command.  I also figured out how to see if the protection was on or off and
change it accordingly through each step.  Now it does exactly what I need!

You think I'm being paranoid, eh?  You may be right.  Requiring a password
to open the thing should be enough of a deterrent to prevent accidental
sharing, especially when the password is DoNotShare !

Your help is MUCH appreciated!!!!

> Perhaps something like
> If ActiveDocument.Background.Fill.Visible = True Then
[quoted text clipped - 45 lines]
>> fantastic!
>> - KC Rippstein
aalaan - 06 Dec 2006 05:12 GMT
Never came across the *publication* of a password before! Nearest was a
prize computer room at a publisher. Behind a glass screen in reception was a
computer system. On large dymo tape to the front of the main monitor was
"SECRET PASSWORD: BLOGGINS" It probably still works...

>... sharing, especially when the password is DoNotShare !
 
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.