Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Initialising wdDialogInsertCrossReference to non-default fields

502 views
Skip to first unread message

Caitlin Dimock

unread,
Feb 19, 2003, 5:32:21 AM2/19/03
to
Hi,

I'm having a problem initilising the option for the
InsertCrossReference dialog box before showing it. Would
really appreciate the help (code below).

Thanks, Caitlin

' I can't get the following to work !!! :-(
' I'm setting the initialisation parameters to be
different to what is
' displayed by default - as example below
' But when the dialog box is show the options are as
for the default
' Basically what I'm trying to do is have this macro
linked to a
' customised toolbar - when the user activates the
insert cross-reference
' dialog box opens to insert a figure with caption and
label only
' The user then chooses the figure and inserts a x-ref
in a standard format
' When I have this sorted I want to do the same for
tables
With Dialogs(wdDialogInsertCrossReference)
Stop
.ReferenceType = wdCaptionFigure
.ReferenceKind = wdOnlyLabelAndNumber
.InsertAsHyperLink = 1
.InsertPosition = 0
.Show
End With

With InsertCrossReference
.ReferenceType =
End With

' This example works - it changes the default format
paragraph dialog to
' initailise to have <KeepWithNext> True and the
<LineSpaceRule> = exactly
With Dialogs(wdDialogFormatParagraph)
.KeepWithNext = 1
.LineSpacingRule = wdLineSpaceExactly
.Show
End With

Dave Lett

unread,
Feb 19, 2003, 10:12:32 AM2/19/03
to
Hi Caitlin,

The parameters of the Dialogs collection is not to be trusted. It's well
known that they are largely undocumented and that many are buggy. When you
run into one that's buggy (in my experience), you have to use and "risky"
work around (that is, you use the SendKeys statement), as in the following:

With Dialogs(wdDialogInsertCrossReference)
SendKeys "ff{TAB}{DOWN 2}{ENTER}"


.InsertAsHyperLink = 1
.InsertPosition = 0
.Show
End With

This works fine in Word 2000 (if I understood your question). With this
example to go on, you can probably work out how to get around your second
issue. Oh, this is interesting, you can type a letter to progromatically
change the selection in the Reference type list, but you must use the down
arrow key to progromatically change the selection in the Insert reference to
list. Buggy, to say the least.

HTH

"Caitlin Dimock" <caitlin...@ast.co.za> wrote in message
news:01e801c2d802$2f42db00$a001...@phx.gbl...

0 new messages