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, 8 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
-
Cox Communications and Charter Communications to merge
by
not so anon
12 minutes ago -
Help with WD usb driver on Windows 11
by
Tex265
5 hours, 22 minutes ago -
hibernate activation
by
e_belmont
9 hours, 8 minutes ago -
Red Hat Enterprise Linux 10 with AI assistant
by
Alex5723
12 hours, 55 minutes ago -
Windows 11 Insider Preview build 26200.5603 released to DEV
by
joep517
16 hours ago -
Windows 11 Insider Preview build 26120.4151 (24H2) released to BETA
by
joep517
16 hours, 2 minutes ago -
Fixing Windows 24H2 failed KB5058411 install
by
Alex5723
19 hours, 12 minutes ago -
Out of band for Windows 10
by
Susan Bradley
20 hours, 45 minutes ago -
Giving UniGetUi a test run.
by
RetiredGeek
1 day, 3 hours ago -
Windows 11 Insider Preview Build 26100.4188 (24H2) released to Release Preview
by
joep517
1 day, 11 hours ago -
Microsoft is now putting quantum encryption in Windows builds
by
Alex5723
1 day, 9 hours ago -
Auto Time Zone Adjustment
by
wadeer
1 day, 15 hours ago -
To download Win 11 Pro 23H2 ISO.
by
Eddieloh
1 day, 13 hours ago -
Manage your browsing experience with Edge
by
Mary Branscombe
18 hours, 4 minutes ago -
Fewer vulnerabilities, larger updates
by
Susan Bradley
6 hours, 30 minutes ago -
Hobbies — There’s free software for that!
by
Deanna McElveen
12 hours, 54 minutes ago -
Apps included with macOS
by
Will Fastie
10 hours, 46 minutes ago -
Xfinity home internet
by
MrJimPhelps
7 hours, 33 minutes ago -
Convert PowerPoint presentation to Impress
by
RetiredGeek
1 day, 8 hours ago -
Debian 12.11 released
by
Alex5723
2 days, 12 hours ago -
Microsoft: Troubleshoot problems updating Windows
by
Alex5723
2 days, 16 hours ago -
Woman Files for Divorce After ChatGPT “Reads” Husband’s Coffee Cup
by
Alex5723
1 day, 20 hours ago -
Moving fwd, Win 11 Pro,, which is best? Lenovo refurb
by
Deo
2 hours, 12 minutes ago -
DBOS Advanced Network Analysis
by
Kathy Stevens
3 days, 9 hours ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
2 days, 23 hours ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
21 hours, 41 minutes ago -
iPhone SE2 Stolen Device Protection
by
Rick Corbett
3 days, 4 hours ago -
Some advice for managing my wireless internet gateway
by
LHiggins
2 days, 12 hours ago -
NO POWER IN KEYBOARD OR MOUSE
by
HE48AEEXX77WEN4Edbtm
1 day, 14 hours ago -
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
3 days, 21 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.