From: Brian Murphy on
I have some code that works fine in Word 2003 for displaying notorious
Insert Cross Reference dialog. This is to display the dialog so as to
insert a cross reference to a Figure caption.
With Dialogs(wdDialogInsertCrossReference)
SendKeys "%t{home}ff"
SendKeys "{enter}"
SendKeys "%r"
SendKeys "{down}"
SendKeys "{enter}"
SendKeys "%w" 'move to list of references
rtn = .Display
End With

This code does not work in Word 2007. In Word 2003 the "ff" moves the
selection first to Footnote, and then to Figure. But in Word 2007 the
second "f" does not get done, and the selection is stuck on Footnote.
I have spent hours trying find something that works, but nothing does.

Does anyone know how to get this to work?

Thanks,

Brian Murphy
From: Doug Robbins - Word MVP on
Try

With Dialogs(wdDialogInsertCrossReference)
SendKeys "%t"
SendKeys "fef"
SendKeys "{enter}"
SendKeys "%r"
SendKeys "{down}"
SendKeys "{enter}"
SendKeys "%w" 'move to list of references
rtn = .Display
End With

I am not sure what would be considered more notoriously unreliable, the
Cross Reference Dialog (which I consider does behave itself better in 2007
than it did in previous versions) or SendKeys.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
"Brian Murphy" <bmurphy(a)xlrotor.com> wrote in message
news:ae3fc50f-f37c-43c7-b05a-6cea0683c8e9(a)v25g2000yqk.googlegroups.com...
>I have some code that works fine in Word 2003 for displaying notorious
> Insert Cross Reference dialog. This is to display the dialog so as to
> insert a cross reference to a Figure caption.
> With Dialogs(wdDialogInsertCrossReference)
> SendKeys "%t{home}ff"
> SendKeys "{enter}"
> SendKeys "%r"
> SendKeys "{down}"
> SendKeys "{enter}"
> SendKeys "%w" 'move to list of references
> rtn = .Display
> End With
>
> This code does not work in Word 2007. In Word 2003 the "ff" moves the
> selection first to Footnote, and then to Figure. But in Word 2007 the
> second "f" does not get done, and the selection is stuck on Footnote.
> I have spent hours trying find something that works, but nothing does.
>
> Does anyone know how to get this to work?
>
> Thanks,
>
> Brian Murphy

From: Brian Murphy on
Thanks for the suggestion, Doug.

I gave it a try, but the problem still remains. The selection is
still stuck on Footnote.

Did you try it yourself and it worked?
If so, what Application.Build of Word2007 are you using?

Brian

On Nov 16, 1:01 am, "Doug Robbins - Word MVP"
<d...(a)REMOVECAPSmvps.org> wrote:
> Try
>
> With Dialogs(wdDialogInsertCrossReference)
> SendKeys "%t"
> SendKeys "fef"
> SendKeys "{enter}"
> SendKeys "%r"
> SendKeys "{down}"
> SendKeys "{enter}"
> SendKeys "%w" 'move to list of references
> rtn = .Display
> End With
>
> I am not sure what would be considered more notoriously unreliable, the
> Cross Reference Dialog (which I consider does behave itself better in 2007
> than it did in previous versions) or SendKeys.
>
> --
> Hope this helps,
>
> Doug Robbins - Word MVP
>
> Please reply only to the newsgroups unless you wish to obtain my services on
> a paid professional basis."Brian Murphy" <bmur...(a)xlrotor.com> wrote in message
>
> news:ae3fc50f-f37c-43c7-b05a-6cea0683c8e9(a)v25g2000yqk.googlegroups.com...
>
> >I have some code that works fine in Word 2003 for displaying notorious
> > Insert Cross Reference dialog. This is to display the dialog so as to
> > insert a cross reference to a Figure caption.
> > With Dialogs(wdDialogInsertCrossReference)
> > SendKeys "%t{home}ff"
> > SendKeys "{enter}"
> > SendKeys "%r"
> > SendKeys "{down}"
> > SendKeys "{enter}"
> > SendKeys "%w" 'move to list of references
> > rtn = .Display
> > End With
>
> > This code does not work in Word 2007. In Word 2003 the "ff" moves the
> > selection first to Footnote, and then to Figure. But in Word 2007 the
> > second "f" does not get done, and the selection is stuck on Footnote.
> > I have spent hours trying find something that works, but nothing does.
>
> > Does anyone know how to get this to work?
>
> > Thanks,
>
> > Brian Murphy

From: Doug Robbins - Word MVP on
Yes, it did work here with Word 2007 (12.0.6514.5000) SP2 MSO
(12.0.6425.1000)

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Brian Murphy" <bmurphy(a)xlrotor.com> wrote in message
news:a5435dd9-2856-4beb-b864-82c986a7623b(a)l2g2000yqd.googlegroups.com...
> Thanks for the suggestion, Doug.
>
> I gave it a try, but the problem still remains. The selection is
> still stuck on Footnote.
>
> Did you try it yourself and it worked?
> If so, what Application.Build of Word2007 are you using?
>
> Brian
>
> On Nov 16, 1:01 am, "Doug Robbins - Word MVP"
> <d...(a)REMOVECAPSmvps.org> wrote:
>> Try
>>
>> With Dialogs(wdDialogInsertCrossReference)
>> SendKeys "%t"
>> SendKeys "fef"
>> SendKeys "{enter}"
>> SendKeys "%r"
>> SendKeys "{down}"
>> SendKeys "{enter}"
>> SendKeys "%w" 'move to list of references
>> rtn = .Display
>> End With
>>
>> I am not sure what would be considered more notoriously unreliable, the
>> Cross Reference Dialog (which I consider does behave itself better in
>> 2007
>> than it did in previous versions) or SendKeys.
>>
>> --
>> Hope this helps,
>>
>> Doug Robbins - Word MVP
>>
>> Please reply only to the newsgroups unless you wish to obtain my services
>> on
>> a paid professional basis."Brian Murphy" <bmur...(a)xlrotor.com> wrote in
>> message
>>
>> news:ae3fc50f-f37c-43c7-b05a-6cea0683c8e9(a)v25g2000yqk.googlegroups.com...
>>
>> >I have some code that works fine in Word 2003 for displaying notorious
>> > Insert Cross Reference dialog. This is to display the dialog so as to
>> > insert a cross reference to a Figure caption.
>> > With Dialogs(wdDialogInsertCrossReference)
>> > SendKeys "%t{home}ff"
>> > SendKeys "{enter}"
>> > SendKeys "%r"
>> > SendKeys "{down}"
>> > SendKeys "{enter}"
>> > SendKeys "%w" 'move to list of references
>> > rtn = .Display
>> > End With
>>
>> > This code does not work in Word 2007. In Word 2003 the "ff" moves the
>> > selection first to Footnote, and then to Figure. But in Word 2007 the
>> > second "f" does not get done, and the selection is stuck on Footnote.
>> > I have spent hours trying find something that works, but nothing does.
>>
>> > Does anyone know how to get this to work?
>>
>> > Thanks,
>>
>> > Brian Murphy
>
From: Brian Murphy on
Well darn!
Do you have both Footnote and Figure in your list of available
reference types?

I have MSO SP2 from the following download
www.microsoft.com/downloads/details.aspx?FamilyID=b444bf18-79ea-46c6-8a81-9db49b4ab6e5&displaylang=en
Word tells me I've got
Word 2007 (12.0.6425.1000) SP2 MSO (12.0.6425.1000)

How can I get build 6514 of Word? I don't really expect it to make
any difference, but you never know.

When I manually do Insert/Cross Reference, I have to type "fef" slowly
to move the selection from Footnote, to Equation, to Figure. If I
type the "fef" quickly, the selection stays on Footnote.

Something wierd is going on. I've tried it on three different
computers with the same result. Grrrr!

Brian