Winhelp

Word Macro: QuickJump

Instant Jump to a Topic of the Same Name…

Macro

Here's a Word macro to automatically create a jump to a topic of the same name; highlight the word or phrase, and hit <alt> J, to make it a jump.

This macro will allow you to highlight single or multiple words, and instantly create a Winhelp jump from the word or phrase. It will replace spaces, hyphens, and apostrophes with underbars for the topic ID. If you plan to use it for text that will have other strange characters, you'll need to add it to the code.

Avoid highlighting the space at the end of the word. It'll think you want it in the jump.

I suggest users assign the QuickJump macro to the <Alt> J keys. You can highlight the word or phrase with the mouse in one hand, and hit <Alt> J to make it a jump with the other hand, and move on. This method takes about 4 seconds per jump.

 

By the way, <Ctrl> J is RoboHelp's QuickTopic macro. Don't assign it that key combination.

 

Note: To create the hyperlinks "on-the-fly," consider using the AutoCorrect feature in Word to replace a predefined word with an already formatted link.

 

 

 

Two steps:

 

 

 

Start

copying à

 

edit as

needed…

 

 

 

 

 

 

 

 

For Popups:

Change

Double à

Underline to

Single

 

 

 

 

 

 

Replacing

Spaces à

in the

Topic ID

 

 

 

 

 

 

 

 

 

Replacing

apostrophes

à

 

 

 

 

 

 

 

 

 

 

 

Replacing

dashes...

à

 

 

 

 

 

 

 

 

 

 

 

Hide the

Topic ID

à

Move to

the first letter

and paste

in the link

 

Stop Copying

à

To use the macro:

 

1.   Paste the code in your macro pages, and…

2.   …assign a keystroke combination to it.

 

First, paste in the macro:

 

Sub QuickJump()

'

' QuickJump Macro

' This Macrosity was first muddled 4/12/00 by Roger Nilsson

'

' Show hidden text

Application.DisplayStatusBar = True

With ActiveWindow

With .View

.ShowHiddenText = True

End With

End With

' format as link text, copy into memory

With Selection.Font

.Underline = wdUnderlineDouble

.ColorIndex = wdGreen

End With

Selection.Copy

Selection.Font.Reset

Selection.Find.ClearFormatting

Selection.Find.Replacement.ClearFormatting

' format same text as the topic ID:

' replace spaces

With Selection.Find

.Text = " "

.Replacement.Text = "_"

.Forward = True

.Wrap = wdFindStop

.Format = False

.MatchCase = False

.MatchWholeWord = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.Execute Replace:=wdReplaceAll

' replace apostrophes

With Selection.Find

.Text = "'"

.Replacement.Text = "_"

.Forward = True

.Wrap = wdFindStop

.Format = False

.MatchCase = False

.MatchWholeWord = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

' replace dashes

Selection.Find.Execute Replace:=wdReplaceAll

With Selection.Find

.Text = "-"

.Replacement.Text = "_"

.Forward = True

.Wrap = wdFindStop

.Format = False

.MatchCase = False

.MatchWholeWord = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.Execute Replace:=wdReplaceAll

' hide topic ID

With Selection.Font

.Hidden = True

.ColorIndex = wdAuto

End With

' paste in the green text

Selection.MoveLeft Unit:=wdCharacter, Count:=1

Selection.Paste

End Sub

‘end of macro 

 

 

To assign the macro to your keyboard (in Word 97®);

1.   In Word, go to Tools\Customize.

2.   Click the "keyboard" button,

3.   Under Categories, choose Macros, QuickJump.

4.   Click in the window to "Press new shortcut key"

5.   Hit <alt> J,

6.   Click assign,

7.   Close,

8.   Close.

 

 

 

Author: Copperfield Publishing

URL: Copperfieldpub.com

 

 

 

 

  

Copyright Copperfield Publishing, 2001, 2002Some relevant topics, perhaps...about the automated lookup system we use on every page...