Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-13-2016, 02:07 PM
jroger05 jroger05 is offline Length of array elements in the ActiveDocument.GetCrossReferenceItems(wdRefTypeHea ding) Windows XP Length of array elements in the ActiveDocument.GetCrossReferenceItems(wdRefTypeHea ding) Office 2003
Novice
Length of array elements in the ActiveDocument.GetCrossReferenceItems(wdRefTypeHea ding)
 
Join Date: Aug 2010
Posts: 6
jroger05 is on a distinguished road
Default Length of array elements in the ActiveDocument.GetCrossReferenceItems(wdRefTypeHea ding)

Can anyone tell me what the length of each element is in the following assignment?

myheader range

myheader = ActiveDocument.GetCrossReferenceItems(wdRefTypeHea ding)

I am having an issue that certain elements of the array returned are not complete, they are truncated and therefore I cannot parse the entire header as needed. Is there a way of specifying a longer length?
Reply With Quote
  #2  
Old 07-13-2016, 04:33 PM
Guessed's Avatar
Guessed Guessed is online now Length of array elements in the ActiveDocument.GetCrossReferenceItems(wdRefTypeHea ding) Windows 10 Length of array elements in the ActiveDocument.GetCrossReferenceItems(wdRefTypeHea ding) Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,995
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
  #3  
Old 07-20-2016, 07:23 AM
jarunsona jarunsona is offline Length of array elements in the ActiveDocument.GetCrossReferenceItems(wdRefTypeHea ding) Windows 7 32bit Length of array elements in the ActiveDocument.GetCrossReferenceItems(wdRefTypeHea ding) Office 2013
Novice
 
Join Date: Jul 2016
Posts: 4
jarunsona is on a distinguished road
Default

Hi

Jroger, i have posted one issue (Want to delete balnk line row from table with MS word using VBA code)

Could you please help me ?
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveDocument.ContentControls(ID) not working Tejas.T Word VBA 3 03-09-2015 06:50 PM
wordapp.ActiveDocument.SaveAs Not Working KSReynolds Mail Merge 1 07-18-2014 04:03 PM
Length of array elements in the ActiveDocument.GetCrossReferenceItems(wdRefTypeHea ding) Using With ActiveDocument.Tables() SuzeG Word VBA 1 01-08-2014 02:00 PM
Length of array elements in the ActiveDocument.GetCrossReferenceItems(wdRefTypeHea ding) Convert String Array to Integer Array from a User Input? tinfanide Excel Programming 4 12-26-2012 08:56 PM
Length of array elements in the ActiveDocument.GetCrossReferenceItems(wdRefTypeHea ding) Array into ComboBox + Macro-Text into ActiveDocument Vivi Word VBA 1 01-27-2010 07:03 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:10 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft