-
WSjweissmn1
AskWoody LoungerMay 11, 2012 at 9:10 am in reply to: How to set the Word Search default focus to “Browse results”? #1332241I don’t know how to set that focus – there is little information available on how to manipulate task panes through VBA.
But if you prefer the old style find, which is now called Advanced Find, here is an article that includes instructions on how to jigger Word so you can get to it easily:
http://www.techandlife.com/2010/07/the-new-search-feature-ctrl-f-in-word-2010/
– Jessica
-
WSjweissmn1
AskWoody LoungerHave you checked to make sure the language for your text is not set to ignore spell check?
Select all your text, and use the Set Language option (I don’t know where it is in 2010, but it is one of the buttons on the right hand side of the Proofing tab in 2007). Clear the Do not check spelling or grammar checkbox and click OK.
– Jessica
-
WSjweissmn1
AskWoody LoungerAre you saying that the entire page shows a grey background?
If so, check what your Normal style is set to in the template, or your character/font default.
If you’re changing the Normal style in a single doc and have Word set to update styles from the template, you’re overwriting the change each time.
– Jessica
-
WSjweissmn1
AskWoody LoungerWhat error message do you get, if any?
What is the goal of your macro?
What happens if you go step by step and trace execution? Anything interesting happening to any of the variables?
If the crashes are truly random, I would suspect that some memory buffer is filling up.
-
WSjweissmn1
AskWoody LoungerSure. You could replace the line that creates the comment with lines that reset the paragraph and character formatting, if you’re feeling brave and don’t want to approve each change.
Replace this:
If sCommentText “” Then
.Comments.Add p.Range, sCommentText
End Ifwith something like this:
If sCommentText “” Then
.Comments.Add p.Range, sCommentText
elsep.Range.ParagraphFormat.Reset
p.Range.Font.ResetEnd If
-
WSjweissmn1
AskWoody LoungerWhat about using document.getCrossReferenceItems to get an array of the numbered clauses, then loop through all the numbered clauses, search for any text matching the clause number elsewhere in the doc, and use selection.insertcrossreference to replace the text with a cross-ref to the numbered clause (with options set for showing the number only)?
Not trivial but a macro jockey with time on his or her hands could do it. I wish I had the time to play with this.
Oh, and for the future you might want to bribe whoever creates the documents to insert the clause references as automated cross-refs to begin with.
– Jessica
-
WSjweissmn1
AskWoody LoungerOk. You’re definitely in macro-land. I think I can see how to do it. You would use document.getCrossReferenceItems to get an array of the numbered clauses, then loop through all the numbered clauses, search for any text matching the clause number elsewhere in the doc, and use selection.insertcrossreference to replace the text with a cross-ref to the numbered clause.
Not trivial but a macro jockey with time on his or her hands could do it. I wish I had the time to play with this.
Oh, and for the future you might want to bribe whoever creates the documents to insert the clause references as automated cross-refs to begin with.
– Jessica
-
WSjweissmn1
AskWoody LoungerApril 26, 2012 at 2:40 pm in reply to: Some questions about Word 2010 – “Macro buttons”, saving the template, etc. #1330482To save your doc as a template, do a Save As and select the .dotm format (macro-enabled template).
There are lots of interesting things you can do with fields and dates, including date calculations.
Is there some reason why you don’t just want to enter the date manually in the document? Knowing the reason will make it easier to help you figure out a solution.
– Jessica
-
WSjweissmn1
AskWoody LoungerYou would have to go through each paragraph and compare the actual formatting of the paragraph to the base format. Here is something that sort of does it. I can’t remember where I got, and I may even have either written or tweaked it myself, though I doubt it. It compares specific aspects of the paragraph’s actual format to the formatting in the basic paragraph style. It adds comments on the non-conforming paragraphs. You could do something else to them, of course.
Sub DetectDirectFormatting()
Dim p As Paragraph
Dim sCommentText As String
Dim sStyle As StringWith ActiveDocument
For Each p In .Paragraphs
‘ line below ignores those end of table row things that are strangeIf Not IsParaEndOfRow(p) Then
sCommentText = “”
sStyle = p.Style
If p.Range.ParagraphFormat.Alignment .Styles(sStyle).ParagraphFormat.Alignment Then
sCommentText = sCommentText & “Alignment. ”
End If
If p.Range.Bold .Styles(sStyle).Font.Bold Then
sCommentText = sCommentText & “Bold. ”
End If
If p.Range.Italic .Styles(sStyle).Font.Italic Then
sCommentText = sCommentText & “italic. ”
End If
If p.Range.Font.Name .Styles(sStyle).Font.Name Then
sCommentText = sCommentText & “Font. ”
End If
If p.Range.ParagraphFormat.LineSpacing .Styles(sStyle).ParagraphFormat.LineSpacing Then
sCommentText = sCommentText & “Line Spacing. ”
End If
If p.Range.ParagraphFormat.SpaceAfter .Styles(sStyle).ParagraphFormat.SpaceAfter Then
sCommentText = sCommentText & “Space After. ”
End IfIf p.Range.ParagraphFormat.LeftIndent .Styles(sStyle).ParagraphFormat.LeftIndent Then
sCommentText = sCommentText & “Left Indent. ”
End If
If p.Range.ParagraphFormat.OutlineLevel .Styles(sStyle).ParagraphFormat.OutlineLevel Then
sCommentText = sCommentText & “outline level. ”
End If
‘ Additional items here
‘If p.Range.ListFormat.ListTemplate .Styles(sStyle).ListTemplate Then
‘sCommentText = sCommentText & ” listTemplate ”
‘End IfIf sCommentText “” Then
.Comments.Add p.Range, sCommentText
End IfEnd If
Next p
End With
End Sub -
WSjweissmn1
AskWoody LoungerAre the original paragraphs you want the cross-reference to lead to created using Word’s outline numbering? And by “cross-reference” do you mean making the text hyperlink?
If so, when you enter the text that refers to clause 2(a)(i) you can do it by entering it as a cross-reference to the original location. In the Enter cross-reference box, select Numbered Items and Paragraph Number.
If you are faced with a doc where someone hand-entered all the references originally, you’re in macro-land. It wouldn’t be a simple macro, either.
– Jessica
-
WSjweissmn1
AskWoody Lounger….turn off Keep Track of Formatting in the options. Then you will see only actual styles in the list.
– Jessica
-
WSjweissmn1
AskWoody LoungerThanks for pointing out SplitTable. I don’t know how I missed that in the docs.
-
WSjweissmn1
AskWoody LoungerI started playing with this in Word 2007 (which is what I have). If the table is the first thing in the header, you get the results you mentioned. I couldn’t put anything above the table either manually or with an ordinary macro.
So I tried something more elaborate. Put a carriage return AFTER the table, and select both the table and the paragraph mark. Then run this code:
Sub insertbefore()
‘
‘ Works ONLY if you select the table AND the paragraph mark after it
‘
‘
Selection.Copy
Selection.DeleteSelection.insertbefore (“dsfsd”)
Selection.Collapse direction:=wdCollapseEnd
Selection.Paste
End SubYou end up with an extra paragraph mark after the table (total of two), and of course you will probably insert something other than “dsfsd”
I leave it to you to put in and delete the extra paragraph marks.
– Jessica
-
WSjweissmn1
AskWoody LoungerFebruary 8, 2012 at 8:48 am in reply to: Number of pages should count only the body of the doc #1318430Thanks – I already have the numbering set up differently for the front sections, and am familiar with the various options.
And yes, Gary, I meant SectionPages
Mr. Kenyon’s solution will work beautifully if I don’t have appendices after the end of the document body and if the front matter is in a single section. But I can probably figure out something based on the technique. My authors like to number appendices in the A-1, B-1 style. So I can probably put white-font SectionPages fields into bookmarks for each appendix, and subtract those values from NumPages along with the front matter SectionPages value or values.
I’ll also see if they want to count the unnumbered pages at the start of some sections.
Thanks for the ideas.
-
WSjweissmn1
AskWoody LoungerTry it with ShapeRange, not Shape.
![]() |
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
-
Who knows what?
by
Will Fastie
1 hour, 54 minutes ago -
My top ten underappreciated features in Office
by
Peter Deegan
1 hour, 21 minutes ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
6 hours, 47 minutes ago -
Misbehaving devices
by
Susan Bradley
1 minute ago -
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
1 day ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
46 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
23 hours ago -
Discover the Best AI Tools for Everything
by
Alex5723
23 hours, 8 minutes ago -
Edge Seems To Be Gaining Weight
by
bbearren
13 hours, 17 minutes ago -
Rufus is available from the MSFT Store
by
PL1
21 hours, 20 minutes ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
2 days ago -
KB5061768 update for Intel vPro processor
by
drmark
20 seconds ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
2 hours, 19 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
1 day, 19 hours ago -
Office gets current release
by
Susan Bradley
1 day, 22 hours ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
3 days, 12 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
2 days, 21 hours ago -
Stop the OneDrive defaults
by
CWBillow
3 days, 13 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
3 days, 23 hours ago -
X Suspends Encrypted DMs
by
Alex5723
4 days, 1 hour ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
4 days, 1 hour ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
4 days, 2 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
4 days, 3 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
3 days, 15 hours ago -
Enabling Secureboot
by
ITguy
3 days, 22 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
4 days, 11 hours ago -
No more rounded corners??
by
CWBillow
4 days, 6 hours ago -
Android 15 and IPV6
by
Win7and10
3 days, 20 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
4 days, 23 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
5 days, 2 hours ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
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.