This is probably a dumb question, but how can you prevent a button on a document from printing? I can find the property on Excel sheets but seem unable to set it in Word.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Preventing controls printing (Word97sr2 VBA)
Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Preventing controls printing (Word97sr2 VBA)
- This topic has 6 replies, 5 voices, and was last updated 23 years, 7 months ago.
AuthorTopicWSEwan Deans
AskWoody LoungerSeptember 13, 2001 at 4:30 pm #360313Viewing 1 reply threadAuthorReplies-
WSWebGenii
AskWoody Lounger -
mvpjjf
AskWoody PlusSeptember 14, 2001 at 1:56 am #542383Just so happens it’s in the FAQ…
-
WSEwan Deans
AskWoody LoungerSeptember 15, 2001 at 12:24 am #542563Thanks for the replies. I think i need to explain a bit more…
I’m generating a multi-choice exam using an excel database of questions and responses. A VBA routine randomly selects a requested number of unique questions and scrambles the answers. A Word doc is used to hold the questions and answers, plus any graphic and the correct response. So the whole list of questions would be in the format:-Some question here?
Response A goes here
Response B goes here
Response C goes here
Response D goes here
Correct reponse is: A – DThe questions are formated as Heading 1style, the choices as Heading 2 style and the correct response para (which also holds any inline graphic) as Heading 3 style. Headings 1 and 2 are set up to outline number and Heading 3 has no number but does have a bottom border. The whole thing works very well, with all questions and responses automatically numbering and lettering plus any graphics below the last reponse being exactly the same width as the column. To toggle between hiding and showing the correct answers i placed a toggle button at the top of the first page to switch the font colour of the Heading 3 style between white and auto.
I checked the FAQ and the text box technique is intresting (if a pain in the ass) but it assumes i want a button for printing. To get the sample code to work i would need to place a button on the document for printing. I even checked for event procedures like Before_print in excel, but no luck. All these things that are in one App but not another is enough to drive you
!!
-
WSjscher2000
AskWoody LoungerSeptember 15, 2001 at 1:32 am #542569Okay, this really is cheating, but… how about putting a section break after the button and then only printing Section 2? I have a couple different automated Word solutions where the first section is data collection and plumbing, and Section 2 is the beautiful result.
If that doesn’t work for you, how about hidden text? I am used to viewing hidden text, so it seems quite natural to me to use the hidden text attribute for that paragraph so it doesn’t print. However, I don’t know whether your users view hidden text. If not, they won’t see the button. This could be toggled in a Document_New or Document_Open macro, if you don’t mind messing with the user’s settings. (Storing the original value to restore on close is not a perfect solution because the user might work with other documents while your document is open…)
All I can think of at the moment.
-
WSEwan Deans
AskWoody LoungerSeptember 15, 2001 at 4:12 pm #542601I’ve decided to use a check box. It’s more discrete than some big grey toggle button and doesn’t require playing around with user settings (which can upset some!!) or putting buttons on the document to specifically hide controls during printing/print certain sections. I am assuming there is no equivalent to a print range in Excel, where once you name it you can leave it alone.
Thanks for the input everyone,
Ewan
P.S. Could start a whole new thread on features in one office app that should be in the others!! -
WSGary Frieder
AskWoody Lounger
-
-
-
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Convert PowerPoint presentation to Impress
by
RetiredGeek
1 hour, 6 minutes ago -
Debian 12.11 released
by
Alex5723
5 hours, 49 minutes ago -
Microsoft: Troubleshoot problems updating Windows
by
Alex5723
9 hours, 30 minutes ago -
Woman Files for Divorce After ChatGPT “Reads” Husband’s Coffee Cup
by
Alex5723
7 hours ago -
Moving fwd, Win 11 Pro,, which is best? Lenovo refurb
by
Deo
5 hours, 58 minutes ago -
DBOS Advanced Network Analysis
by
Kathy Stevens
1 day, 2 hours ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
16 hours, 50 minutes ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
1 day, 5 hours ago -
iPhone SE2 Stolen Device Protection
by
Rick Corbett
21 hours, 21 minutes ago -
Some advice for managing my wireless internet gateway
by
LHiggins
4 hours, 54 minutes ago -
NO POWER IN KEYBOARD OR MOUSE
by
HE48AEEXX77WEN4Edbtm
23 hours, 18 minutes ago -
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
1 day, 14 hours ago -
Sometimes I wonder about these bots
by
Susan Bradley
1 day, 10 hours ago -
Does windows update component store “self heal”?
by
Mike Cross
1 day ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
2 days, 4 hours ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
12 hours, 29 minutes ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
1 hour, 8 minutes ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
2 days, 7 hours ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
2 days, 7 hours ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
1 day, 19 hours ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
2 days, 15 hours ago -
0Patch, where to begin
by
cassel23
2 days, 9 hours ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
3 days, 5 hours ago -
89 million Steam account details just got leaked,
by
Alex5723
2 days, 16 hours ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
3 days, 13 hours ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
3 days, 4 hours ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
6 hours, 44 minutes ago -
Installer program can’t read my registry
by
Peobody
11 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
3 days, 2 hours ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
3 days, 9 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.