-
WSsolomod
AskWoody LoungerSorry guys – didn’t read the post from Hans properly… I read it as check it. So I’ve just cleared it and it works perfectly.
I’ve been living in France for the last five years so perhaps the the red wine has something to do with it.
Many thanks,
David
-
WSsolomod
AskWoody LoungerHello Hans,
Sorry to say it already is.
Many thanks,
David
-
WSsolomod
AskWoody LoungerWell, I am pleased. I retire in September to France to run a B&B and to restore the old cottage next door… I cannot often contribute but I have had so much help from the Forum over the last few years.
Glad to have been of help.
David
-
WSsolomod
AskWoody LoungerI use this macro on my forms – it unprotects the doc, finds the last table, copies it, adds a page and pastes the table on, then clears the table entries. I activate the macro from a command button on the first page.
Sub add_page()
Dim pass
Dim table_num As Integer
Dim i As Integerpass = “your password here”
i = ActiveDocument.Tables.count
table_num = i
ActiveDocument.Unprotect Password:=(pass)
With ActiveDocument.Tables(table_num)
.Select
End WithSelection.copy
Selection.EndKey Unit:=wdStory
Selection.InsertBreak Type:=wdPageBreak
Selection.Pastei = ActiveDocument.Tables.count
table_num = i
With ActiveDocument.Tables(table_num)
.Select
Selection.Fields.Update
End WithActiveDocument.Protect Password:=(pass), NoReset:=True, Type:=wdAllowOnlyFormFields
End Sub
-
WSsolomod
AskWoody LoungerYes!!!
Don’t apologise Hans – I salute you. I worried away all yesterday afternoon trying to make it work.
Many thanks – treat yourself to a coffee and a cake.
Regards,
David
-
WSsolomod
AskWoody LoungerPrinting okay now except… It prints the correct number of files, say 5 for a five-page document, but instead of printing page 1 in file 1, page 2 in file 2 etc it prints 5 files containg all the pages.
Think it’s time for coffee.
Regards,
David
-
WSsolomod
AskWoody LoungerHi Hans,
Still getting an error “Invalid print range” – code looks like this:
For i = 1 To page_num
svPdfName = “d:batcher” & “testing again ” & i & “.pdf”
System.PrivateProfileString(svPDFIni, “Acrobat PDFWriter”, “PDFFilename”) = svPdfName
ActiveDocument.PrintOut Background:=0, Range:=wdPrintRangeOfPages, outputFilename:=””, _
Item:=wdPrintDocumentContent, Copies:=1, Pages:=Chr(34) & i & Chr(34), PageType:=wdPrintAllPages, PrintToFile:=False, Collate:=FalseNext i
Many thanks,
David
-
WSsolomod
AskWoody LoungerHello Fred,
Sorry for delay in reply – just back from Provence. Very cold but sunny.
I ran the IsDate code as part of the email macro that was triggered by the “Email this Form” command button at the top of the form. I could never get SendKeys to work.
If you are not e-mailing the form I presume you are either printing it straight off and/or saving to the users harddrive so I would put a command button next to the last field. The button would either print or offer the save dialogue. You could run the validation macro from that.
You could also leave the last field as a field that does not require validation. That was my easy option (move the date field to the beginning of the form so that the user would tab out of it) but the other validation processes used field numbers and I could not face the thought of sorting all the numbers out again in the macro.
However I do not know of any way to validate a last field if the user just saves from the File drop-down. I think we need Kevin or Hans here!
Regards,
David
-
WSsolomod
AskWoody LoungerHello Kevin,
I was running the code off the command button but a Google search unearthed IsDate so I have used that and it works okay:
Dim test_date
test_date = ActiveDocument.FormFields(“disposal_date”).ResultIf Not IsDate(test_date) Then
MsgBox “Please enter a valid date”, vbCritical & vbOKOnly, “Error”
ActiveDocument.Bookmarks(“disposal_date”).Range.Fields(1).Result.Select
Exit Sub
End IfMany thanks,
David
-
WSsolomod
AskWoody LoungerHans,
Thanks for the tip. The button is located on the page; I dug around in Help and found out how to work a yes/no message box and used that instead.
All the best for the New Year,
David
-
WSsolomod
AskWoody LoungerHans,
Just found your macro when presented with a pile of files to combine…
Couldn’t make Andrew’s solution work and I used a tip from the MVP to amend yours to:
Sub CombineDocs()
Dim sPath As String
Dim doc As Document
Dim strFileName As StringWith Dialogs(wdDialogCopyFile)
If .Display 0 ThensPath = .Directory
Else
MsgBox “Dialog cancelled”
End If
End WithSet doc = Documents.Add
strFileName = Dir(sPath & “*.doc”)
Do While strFileName “”
Selection.InsertFile sPath & “” & strFileName
Selection.InsertBreak wdSectionBreakNextPage
strFileName = Dir
LoopEnd Sub
Worked fine for me – many thanks to you & andrew and maybe this amended version will be of use to someone.
David
-
WSsolomod
AskWoody LoungerThank you Hans – every one a winner.
David
-
WSsolomod
AskWoody LoungerYou need the full version of Adobe Acrobat.
David
-
WSsolomod
AskWoody LoungerCreate each pdf file seperately. In Acrobat open the first pdf then insert the remaining files one after the other. Save as one file.
David
-
WSsolomod
AskWoody LoungerOctober 17, 2002 at 4:56 am in reply to: Macro: print each sheet to pdf using sheet name as (Excel 97 sr-2 Win95) #624771Thanks to everybody for the help – I’ve just rattled through about 500 sheets producing 2-page pdf files in a couple of minutes.
David
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

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
-
OTF, which backs Tor, Let’s Encrypt and more, sues to save its funding
by
Nibbled To Death By Ducks
2 hours, 9 minutes ago -
El Canal Maritimo (Awaiting moderation)
by
lourdespinson24
3 hours, 5 minutes ago -
Select multiple emails and they all open up! (Awaiting moderation)
by
CeeJay
8 hours, 28 minutes ago -
How to remove an update preview (Awaiting moderation)
by
Gunny
10 hours, 18 minutes ago -
Updating Windows 10 to Windows 11: 23H2 or 24H2?
by
Still Anonymous
12 hours, 52 minutes ago -
How can I update “Explorer Patcher”
by
WSplanckster
14 hours, 45 minutes ago -
Check out the home page for Signal
by
CAS
12 hours, 38 minutes ago -
Windows 11 and Trial version of MS Office
by
Tex265
11 hours, 41 minutes ago -
Windows 11 Insider Preview build 26120.3585 (24H2) released to BETA
by
joep517
19 hours, 9 minutes ago -
Windows 11 Insider Preview build 26200.5510 released to DEV
by
joep517
19 hours, 12 minutes ago -
Windows 11 Insider Preview Build 26100.3624 (24H2) released to Release Preview
by
joep517
19 hours, 16 minutes ago -
Limits on User Names
by
CWBillow
15 hours, 58 minutes ago -
MS-DEFCON 4: Mixed bag for March
by
Susan Bradley
10 hours, 2 minutes ago -
Non Apple Keyboards
by
pmcjr6142
59 minutes ago -
How to delete your 23andMe data – The Verge
by
AJNorth
13 hours, 55 minutes ago -
7 common myths about Windows 11 (Microsoft AD)
by
EyesOnWindows
11 hours, 31 minutes ago -
Error updating to Win11 0x8024a205
by
bmeacham
1 day, 13 hours ago -
default apps
by
chasfinn
1 day, 13 hours ago -
Will MS Works 4 work in MS Win 11?
by
MileHighFlyer
1 day, 21 hours ago -
Adding links to text in Word 2000
by
sgeneris
18 hours, 12 minutes ago -
FBI warnings are true—fake file converters do push malware
by
Nibbled To Death By Ducks
1 day, 14 hours ago -
Classic and Extended Control Panel — no need to say goodbye
by
Deanna McElveen
16 hours, 54 minutes ago -
Things you can do in 2025 that you couldn’t do in 2024
by
Max Stul Oppenheimer
2 days, 1 hour ago -
Revisiting Windows 11’s File Explorer
by
Will Fastie
1 day, 10 hours ago -
Planning ahead for migration
by
Susan Bradley
10 hours, 47 minutes ago -
Yahoo mail getting ornery
by
Tom in Az
1 day, 13 hours ago -
Is Spectrum discontinuing email service?
by
Peobody
1 day, 16 hours ago -
Practice what you preach! A cautionary tale.
by
RetiredGeek
1 day, 13 hours ago -
Looking for Microsoft Defender Manuals/Tutorial
by
blueboy714
1 day, 17 hours ago -
Win 11 24H2 Home or Pro?
by
CWBillow
1 day, 14 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.