TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
Macro Solution for Only Label and Number - Thank you
Subject:Macro Solution for Only Label and Number - Thank you From:"Hemstreet, Deborah" <DHemstreet -at- kaydon -dot- com> To:"Jonathan West" <jwest -at- mvps -dot- org> Date:Mon, 29 Sep 2008 14:59:50 -0400
Major thanks to Jonathan West for his solution.
I now have two nifty macros for helping employees quickly cross-ref
figures and tables - here they are, tested and working in MS Word 2003 -
for anyone who would like. I have a toolbar and have mapped these to a
toolbar (and a short-cut key on my own add-in template).
Many thanks!
Deborah
Sub CrossRefFigure()
'
' Written 9/29/2008 by Deborah Hemstreet with help of Jonathan West
'
With Dialogs(wdDialogInsertCrossReference)
SendKeys "ff{TAB}{DOWN}{DOWN}~%w": .Show
End With
End Sub
-------------------------------------------------------------------
Sub CrossRefTable()
'
' Written 9/29/2008 by Deborah Hemstreet with help of Jonathan West
'
With Dialogs(wdDialogInsertCrossReference)
SendKeys "tt{TAB}{DOWN}{DOWN}~%w": .Show
End With
End Sub
-----Original Message-----
From: jonathanwest22 -at- googlemail -dot- com
[mailto:jonathanwest22 -at- googlemail -dot- com] On Behalf Of Jonathan West
Sent: Monday, September 29, 2008 12:58 PM
To: Hemstreet, Deborah
Cc: techwr-l -at- lists -dot- techwr-l -dot- com
Subject: Re: Can you help me with this macro? (Word 2003)
2008/9/29 Hemstreet, Deborah <DHemstreet -at- kaydon -dot- com>:
> Hi All,
>
> Below my question is a macro I've recorded. My question: I want this
> macro to merely open the Cross Reference dialog box, with it pre-set
to
> insert a Figure with the Only Label and Number option selected. The
user
> would then select the figure number, insert the ref and close the
dialog
> box.
>
> Is there a way to modify this macro for the above desired action? My
> attempts have failed.
>
Not easy, as the dialog doesn't respond as it should to setting the
dialog box arguments, so you have to use SendKeys which can be rather
flaky. But this does seem to work.
With Dialogs(wdDialogInsertCrossReference)
SendKeys "ff{TAB}{DOWN}{DOWN}~%w": .Show
End With
The "ff" sets the reference kind to Figure. The "{TAB}" moves the
focus across to the "Insert reference to" box. "{DOWN}{DOWN}" opens
the dropdown and moves down one item. "~" selects and closes the
dropdown. "%w" moves the focus to the "For which heading" dialog.
ComponentOne Doc-To-Help gives you everything you need to author and
publish quality Help, Web, and print content. Perfect for technical
authors, developers, and policy writers. Download a FREE trial. http://www.componentone.com/DocToHelp/
True single source, conditional content, PDF export, modular help.
Help & Manual is the most powerful authoring tool for technical
documentation. Boost your productivity! http://www.helpandmanual.com
---
You are currently subscribed to TECHWR-L as archive -at- web -dot- techwr-l -dot- com -dot-