View Single Post
 
Old 07-13-2016, 04:33 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

It seems to be truncating the text at 94 or 95 characters in my testing. I have no idea on how to entice GetCrossReferenceItems to return longer strings.
Code:
  Dim arr() As String, s As Variant
  arr = ActiveDocument.GetCrossReferenceItems(wdRefTypeHeading)
  For Each s In arr
    Debug.Print s, Len(s)
  Next
I can see how this could be a problem but I would have to say that your headings are too long if you can't identify the right one within 95 characters. You could always loop through the paragraphs to populate the array instead of doing it the easy way.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote