From: nerfemail on
Hi,

I'm working on a big document and I need to know if there is a faster way to
insert cross-reference links.

On every chapter (H1), I insert a list of of sub-headers (H2). It looks like
this:
-----------------------------
1. Chapter One
- Section 1.1 "title" on page 99
-----------------------------

What I am currently doing is, "insert > reference > cross-reference >".
Then select the target heading, with "heading number", then the same for
header text and header page. This takes a long time, as i have to scroll the
list of headers (long) for each of the three components of each reference.

Is there any way of inserting all three components with a single click (or
faster than what I am doing now?

Basically, I would like to say:
- insert reference link to heading 1.1 and it would automatically output "-
Section 1.1 "title" on page 99", where "1.1" is the header number, "title" is
the title text and "99" is the header page number

thank you for your help.


From: Stefan Blom on
Unfortunately, there is no way to cross-reference heading text, heading number,
and page number without inserting three separate cross-references.

--
Stefan Blom
Microsoft Word MVP
(Message posted via NNTP)



"nerfemail(a)gmail.com" <nerfemail(a)gmail.com@discussions.microsoft.com> wrote in
message news:20069211-1FAC-4A0D-9422-6C5C097E232B(a)microsoft.com...
> Hi,
>
> I'm working on a big document and I need to know if there is a faster way to
> insert cross-reference links.
>
> On every chapter (H1), I insert a list of of sub-headers (H2). It looks like
> this:
> -----------------------------
> 1. Chapter One
> - Section 1.1 "title" on page 99
> -----------------------------
>
> What I am currently doing is, "insert > reference > cross-reference >".
> Then select the target heading, with "heading number", then the same for
> header text and header page. This takes a long time, as i have to scroll the
> list of headers (long) for each of the three components of each reference.
>
> Is there any way of inserting all three components with a single click (or
> faster than what I am doing now?
>
> Basically, I would like to say:
> - insert reference link to heading 1.1 and it would automatically output "-
> Section 1.1 "title" on page 99", where "1.1" is the header number, "title" is
> the title text and "99" is the header page number
>
> thank you for your help.
>
>


From: Doug Robbins - Word MVP on
After inserting a cross reference to the paragraph number, select it and
then run a macro containing the following code

Dim fcode As Range
Dim ftext As String
Set fcode = Selection.Fields(1).Code
ftext = Replace(fcode.Text, "\r", "")
Selection.InsertBefore "- Section "
Selection.InsertAfter " " & Chr(34)
Selection.Collapse wdCollapseEnd
ActiveDocument.Fields.Add Selection.Range, wdFieldEmpty, ftext
Selection.Collapse wdCollapseEnd
Selection.InsertAfter Chr(34) & " on page "
Selection.Collapse wdCollapseEnd
ActiveDocument.Fields.Add Selection.Range, wdFieldEmpty, Replace(ftext,
"REF", "PAGEREF")


and if the cross reference displayed 1,1, you would get

- Section 1.1 "[Heading 2 text]" on page [page number]

See the following page of fellow MVP Graham Mayor's website if you do not
know what to do with the above code:

http://www.gmayor.com/installing_macro.htm

--
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

"nerfemail(a)gmail.com" <nerfemail(a)gmail.com@discussions.microsoft.com> wrote
in message news:20069211-1FAC-4A0D-9422-6C5C097E232B(a)microsoft.com...
> Hi,
>
> I'm working on a big document and I need to know if there is a faster way
> to
> insert cross-reference links.
>
> On every chapter (H1), I insert a list of of sub-headers (H2). It looks
> like
> this:
> -----------------------------
> 1. Chapter One
> - Section 1.1 "title" on page 99
> -----------------------------
>
> What I am currently doing is, "insert > reference > cross-reference >".
> Then select the target heading, with "heading number", then the same for
> header text and header page. This takes a long time, as i have to scroll
> the
> list of headers (long) for each of the three components of each reference.
>
> Is there any way of inserting all three components with a single click (or
> faster than what I am doing now?
>
> Basically, I would like to say:
> - insert reference link to heading 1.1 and it would automatically output
> "-
> Section 1.1 "title" on page 99", where "1.1" is the header number, "title"
> is
> the title text and "99" is the header page number
>
> thank you for your help.
>
>
From: Stefan Blom on
Clever!

--
Stefan Blom
Microsoft Word MVP



"Doug Robbins - Word MVP" <dkr(a)REMOVECAPSmvps.org> wrote in message
news:224BA609-2AE3-4EB4-8312-054A9C827A8F(a)microsoft.com...
> After inserting a cross reference to the paragraph number, select it and then
> run a macro containing the following code
>
> Dim fcode As Range
> Dim ftext As String
> Set fcode = Selection.Fields(1).Code
> ftext = Replace(fcode.Text, "\r", "")
> Selection.InsertBefore "- Section "
> Selection.InsertAfter " " & Chr(34)
> Selection.Collapse wdCollapseEnd
> ActiveDocument.Fields.Add Selection.Range, wdFieldEmpty, ftext
> Selection.Collapse wdCollapseEnd
> Selection.InsertAfter Chr(34) & " on page "
> Selection.Collapse wdCollapseEnd
> ActiveDocument.Fields.Add Selection.Range, wdFieldEmpty, Replace(ftext, "REF",
> "PAGEREF")
>
>
> and if the cross reference displayed 1,1, you would get
>
> - Section 1.1 "[Heading 2 text]" on page [page number]
>
> See the following page of fellow MVP Graham Mayor's website if you do not know
> what to do with the above code:
>
> http://www.gmayor.com/installing_macro.htm
>
> --
> 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
>
> "nerfemail(a)gmail.com" <nerfemail(a)gmail.com@discussions.microsoft.com> wrote in
> message news:20069211-1FAC-4A0D-9422-6C5C097E232B(a)microsoft.com...
>> Hi,
>>
>> I'm working on a big document and I need to know if there is a faster way to
>> insert cross-reference links.
>>
>> On every chapter (H1), I insert a list of of sub-headers (H2). It looks like
>> this:
>> -----------------------------
>> 1. Chapter One
>> - Section 1.1 "title" on page 99
>> -----------------------------
>>
>> What I am currently doing is, "insert > reference > cross-reference >".
>> Then select the target heading, with "heading number", then the same for
>> header text and header page. This takes a long time, as i have to scroll the
>> list of headers (long) for each of the three components of each reference.
>>
>> Is there any way of inserting all three components with a single click (or
>> faster than what I am doing now?
>>
>> Basically, I would like to say:
>> - insert reference link to heading 1.1 and it would automatically output "-
>> Section 1.1 "title" on page 99", where "1.1" is the header number, "title" is
>> the title text and "99" is the header page number
>>
>> thank you for your help.
>>
>>