We help IT Professionals succeed at work.
Get Started

Macro in Word to Search by Named Style

oaktrees
oaktrees asked
on
147 Views
Last Modified: 2020-03-16
I've got a style that I do lots of commenting in.  

Microsoft Word has got a search by style built-in, but it's pretty clunky.

Is there any way to modify this Macro to have it search for a named style?

The style name I'm using is

chrAComms

And it is a character style.

Sub aaag_HeaderDown()
On Error GoTo ErrorHandler
Selection.GoTo What:=wdGoToHeading, Which:=wdGoToNext, Count:=1, Name:=""
ErrorHandler:
End Sub

Sub aaah_HeaderUp()
On Error GoTo ErrorHandler
Selection.GoTo What:=wdGoToHeading, Which:=wdGoToPrevious, Count:=1, Name:=""
ErrorHandler:
End Sub

Open in new window


My thinking here is that f I can get a Macro to run the style search, I can set two keyboard shoorcuts and blaze through to the comments I need to see.

Many thanks!!

OT
Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE