Highlight some text on startup

I

Ian H

Hi there,

I'm a complete novice at word programming
- normally I'd take the time to work this out for myself, but I need to get
something going really quickly.

Is there an easy way to start word with some text within the opened document
automatically highlighted?

e.g. winword /m:highlight "TEXT PHRASE" or "SINGLEWORD"

Would highlight all the occurences of the text phrase or the singleword.

All help gratefully received.

Thanks,
Ian.
 
W

Word Heretic

G'day "Ian H" <[email protected]>,

The Document_Open event can do a FnR with that text and highlighting
set on the target. Use the dropdowns inside of the ThisDocument object
in your VBE (Alt+F11).


Dim Marker as Range

Set Marker=ActiveDocument.Content
With Marker.Find
'have fun in here with stuff like .Text=... just type a . and it
'autocompletes



.execute replace:=wdreplaceall
end with
set marker=nothing



Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


Ian H reckoned:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top