I hope I can explain this properly. I have one page coversheet for legal exhibits. I have been asked to create a macro that asks the user how many of these sheets needs to be created and then inserts that many pages into the document and numbers each one (exhibit 1, exhibit 2, etc). I also need to ask the user if they want the exhibits numbered 1,2,3 or a,b,c. I know that I need to use SEQ codes for this but can’t get my head around where to start or what the code needs to be like. Can anyone help????
![]() |
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 |
-
macro to specify number (VBA Office XP)
Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » macro to specify number (VBA Office XP)
- This topic has 4 replies, 2 voices, and was last updated 21 years, 2 months ago.
AuthorTopicWSGirlFriday
AskWoody LoungerApril 5, 2004 at 4:16 pm #403272Viewing 1 reply threadAuthorReplies-
WSjscher2000
AskWoody LoungerApril 5, 2004 at 9:58 pm #810055What if you cheat a bit… Put the text in the header, use a page number code for the exhibit number, and just insert page breaks for each desired page. The only hard part is that you need to insert a switch into the page number code that tells it whether to use regular numbers or regular letters. Or you could save one of each as an AutoText, and insert the AutoText desired by the user.
But… to use SEQ fields, perhaps something like this:
Sub MakePages() Dim intNumExhibits As Integer, strNumStyle As String, intCounter As Integer intNumExhibits = CInt(InputBox("How many exhibit cover sheets would you like?")) If MsgBox("Use letters instead of numbers?", vbYesNo) = vbYes Then strNumStyle = "* Alphabetic" Else strNumStyle = "* Arabic" End If For intCounter = 1 To intNumExhibits With Selection .TypeText "Exhibit " .Fields.Add .Range, wdFieldSequence, "Exhibit " & strNumStyle If intCounter < intNumExhibits Then .InsertBreak wdPageBreak End If End With Next End Sub
When I try this in Word 2002, I get a “bonk” noise after the InputBox, but I can’t tell what’s causing it. Hmmm… maybe specifying an icon for the MsgBox would fix that.
-
WSGirlFriday
AskWoody Lounger -
WSGirlFriday
AskWoody Lounger
-
-
WSjscher2000
AskWoody LoungerApril 5, 2004 at 9:58 pm #810056What if you cheat a bit… Put the text in the header, use a page number code for the exhibit number, and just insert page breaks for each desired page. The only hard part is that you need to insert a switch into the page number code that tells it whether to use regular numbers or regular letters. Or you could save one of each as an AutoText, and insert the AutoText desired by the user.
But… to use SEQ fields, perhaps something like this:
Sub MakePages() Dim intNumExhibits As Integer, strNumStyle As String, intCounter As Integer intNumExhibits = CInt(InputBox("How many exhibit cover sheets would you like?")) If MsgBox("Use letters instead of numbers?", vbYesNo) = vbYes Then strNumStyle = "* Alphabetic" Else strNumStyle = "* Arabic" End If For intCounter = 1 To intNumExhibits With Selection .TypeText "Exhibit " .Fields.Add .Range, wdFieldSequence, "Exhibit " & strNumStyle If intCounter < intNumExhibits Then .InsertBreak wdPageBreak End If End With Next End Sub
When I try this in Word 2002, I get a “bonk” noise after the InputBox, but I can’t tell what’s causing it. Hmmm… maybe specifying an icon for the MsgBox would fix that.
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
-
Apple, Google stores still offer China-based VPNs, report says
by
Nibbled To Death By Ducks
5 hours, 39 minutes ago -
Search Forums only bring up my posts?
by
Deo
5 hours, 52 minutes ago -
Windows Spotlight broken on Enterprise and Pro for Workstations?
by
steeviebops
17 hours, 21 minutes ago -
Denmark wants to dump Microsoft for Linux + LibreOffice
by
Alex5723
9 hours, 58 minutes ago -
How to get Microsoft Defender to honor Group Policy Setting
by
Ralph
17 hours, 57 minutes ago -
Apple : Paragon’s iOS Mercenary Spyware Finds Journalists Target
by
Alex5723
1 day, 4 hours ago -
Music : The Rose Room – It’s Been A Long, Long Time album
by
Alex5723
1 day, 5 hours ago -
Disengage Bitlocker
by
CWBillow
19 hours, 10 minutes ago -
Mac Mini M2 Service Program for No Power Issue
by
Alex5723
1 day, 7 hours ago -
New Win 11 Pro Geekom Setup questions
by
Deo
5 hours, 48 minutes ago -
Windows 11 Insider Preview build 26200.5651 released to DEV
by
joep517
1 day, 14 hours ago -
Windows 11 Insider Preview build 26120.4441 (24H2) released to BETA
by
joep517
1 day, 14 hours ago -
iOS 26,, MacOS 26 : Create your own AI chatbot
by
Alex5723
1 day, 18 hours ago -
New PC transfer program recommendations?
by
DaveBoston
5 hours, 44 minutes ago -
Windows 11 Insider Preview Build 22631.5545 (23H2) released to Release Preview
by
joep517
1 day, 22 hours ago -
Windows 10 Build 19045.6029 (22H2) to Release Preview Channel
by
joep517
1 day, 22 hours ago -
Best tools for upgrading a Windows 10 to an 11
by
Susan Bradley
1 day, 10 hours ago -
The end of Windows 10 is approaching, consider Linux and LibreOffice
by
Alex5723
14 hours, 51 minutes ago -
Extended Windows Built-in Disk Cleanup Utility
by
bbearren
23 hours, 45 minutes ago -
Win 11 24H2 June 2025 Update breaks WIFI
by
dportenlanger
2 days, 17 hours ago -
Update from WinPro 10 v. 1511 on T460p?
by
CatoRenasci
1 day, 15 hours ago -
System Restore and Updates Paused
by
veteran
2 days, 19 hours ago -
Windows 10/11 clock app
by
Kathy Stevens
2 days, 7 hours ago -
Turn off right-click draw
by
Charles Billow
2 days, 23 hours ago -
Introducing ChromeOS M137 to The Stable Channel
by
Alex5723
3 days, 2 hours ago -
Brian Wilson (The Beach Boys) R.I.P
by
Alex5723
9 hours, 24 minutes ago -
Master patch listing for June 10, 2025
by
Susan Bradley
3 days, 4 hours ago -
Suggestions for New All in One Printer and a Photo Printer Windows 10
by
Win7and10
2 hours, 27 minutes ago -
Purchasing New Printer. Uninstall old Printer Software First?
by
Win7and10
3 days, 10 hours ago -
KB5060842 Issue (Minor)
by
AC641
1 day, 22 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.