Forum


Replies: 3   Views: 2388
Cross-reference to paragraph number
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by skicka.spam.hit  · 23-09-2017 - 21:52

Hi, 

Is it possible to add a cross reference to a paragraph number (as the word cross reference menu/dialouge provides for)? I have a layout as follows: 

--

Some text.... and:

(a) text in para a

(b) text in para b

     (i) subtext in para b

 

If possible, I would like to be able to make a crossreference to for instance paragraph (a) but also to subparagraph (i) in paragraph (b).

 

Thanks.

Mjui

Posted by admin  · 24-09-2017 - 08:24

Hello,

You can add bookmarks at almost any point of the document, so it can be done adding a custom bookmark and reference the bookmark name using the addCrossRefence method.

Regards.

Posted by skicka.spam.hit  · 24-09-2017 - 14:17

Thank you. 

I had a look at that example but do not really see how the "bookmark" cross reference can achieve my purpose. I want the paragraph list item, i.e the "(a)", itself to be the reference target. When I add a bookmark to the text included in the (a) paragraph and then add a cross reference to that bookmark, the cross reference text/link (when updated) is set to "1" whereas I want it to show "(a)".

When adding a cross reference in Word, the dialouge allows you to choose "Reference type" (e.g. "Numbered item", "Heading", "Bookmark" etc) and what I think I need is the possibility to make a cross reference to a "Numbered item" (in my case the numbered item (a)). Is that at all possible? Can this be done with the premium version of phpdocx or so? 

Thanks in advance. 

Best, 

Posted by admin  · 24-09-2017 - 15:18

Hello,

Yes, using a Premium license you can accomplish what you need using the features available in this package. DOCXPath can ease doing this kind of tasks.

If you purchase a license, please contact us again (update this same topic) and the dev team will generate a script to illustrate you how to do it (they usually send custom scripts by email, so we recommend you to sign up using a real email).

Regards.