Book a Demo

Author Topic: hyperlinks.count in saved Linked Document is not correct ?  (Read 4519 times)

jumbie

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Hi all,

I have this problem:

I insert a few links from EA into the text of Linked Doc.
When I copy text from a Linked Document to Word using Clipboard (CTRL A, CTRL C in Linked Doc and CRL V in Word Doc) and run a simple test macro in Word doc:

Code: [Select]
MsgBox ActiveDocument.Hyperlinks.Count
the number of hyperlinks is OK.

However, if I save Linked Doc using SaveLinkedDocument and add this macro in the saved Word doc and run it, then the number of hyperlinks is much higher and it is not correct.

Where is the problem?


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: hyperlinks.count in saved Linked Document is not correct ?
« Reply #1 on: July 06, 2021, 03:45:33 am »
I think you might want to examine the document in detail.

A .docx is actually a zip file containing a number of xml files.
If you rename your .docx to .zip, and then unzip the files, you can search in the xml files using a text editor.

This should reveal why Word counts that many hyperlinks, and should give you an idea how to exclude those.

Geert

jumbie

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: hyperlinks.count in saved Linked Document is not correct ?
« Reply #2 on: July 06, 2021, 06:07:29 am »
Hi Geert,

thanks for the advice, it helped a lot,

I studied XML in zip and found that some hyperlinks repeat,
and they were the ones I edited in Linked Doc after the insert from EA.

! The hyperlink text in Linked Doc must not be changed in any way by editing !

Thanks a lot :)

Jumbie.