Re: Glitch in GetCrossReferenceItems
- From: zkid <zkid@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 11 Dec 2007 16:52:00 -0800
Okay, how about this? I tweaked your for loop just a bit to show what's in
the container. By using trim, the blank heading came back as 0!
For I = 1 To UBound(varXrefs)
Selection.InsertAfter varXrefs(I) & vbNewLine
MsgBox Len(Trim(varXrefs(I)))
Next I
"Bear" wrote:
zkid:.
Alas, no. The container is returned with no empty elements. For example, if
I had ten headings, but one was blank, the getcrossreferenceitems method
fills my variant (array) with nine items.
Sigh.
Bear
PS: Thanks for trying so hard. I appreciate it.
--
Windows XP, Word 2000
"zkid" wrote:
Bear, when you load the list box from the cross-reference container, you can
use a for loop to check to determine if each entry is empty, yes? Then, if
so, don't load it into the list box. Will that work?
"Bear" wrote:
Shauna:
Obviously, I'd appreciate any help you can provide. I'm at the point of
considering if there's any way to perform a test each time the user attempts
to insert a cross-reference, just to warn them that the x-ref they just
inserted was incorrect. But I don't know of a good way to actually examine
the x-ref just inserted.
Bear
--
Windows XP, Word 2000
"Shauna Kelly" wrote:
Bear
I can repro your problem exactly as you describe it. Give me a little
while (that's deliberately vague, but it probably means a day or two) to
see if I have any code lying around the place that might help.
But I suspect there's no way around this.
Shauna
Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
"Bear" <david.chinell@xxxxxx(nospam)> wrote in message
news:0B013163-0CCF-4F34-B96D-C6EAF7DC38B1@xxxxxxxxxxxxxxxx
I hope Shauna reads this. Just one more oddity about
GetCrossReferenceItems
and InsertCrossReference. But maybe you've found a way around it...
You can test this out yourself fairly easily. Create a document with
three
Heading 1 paras in it. Type Before in the first, nothing in the
second, and
After in the third.
GetCrossReference items will not include the empty para! (If it's a
Heading
2 or 3 etc, it will -- it just skips empty Heading 1 paras.)
This means that if I fill a listbox with GetCrossReference, let the
user
pick one, and use the listbox index to specify the
InsertCrossReference item,
everything after the blank para will be off by one. You try to insert
Title 7
and you get Title 6 etc.
I can't think of any efficient way to stop this, or even warn the user
that
something's amiss. (Typically it's because a section break gets styled
as
Heading 1.)
Any ideas?
Bear
--
Windows XP, Word 2000
- References:
- Re: Glitch in GetCrossReferenceItems
- From: Shauna Kelly
- Re: Glitch in GetCrossReferenceItems
- From: Bear
- Re: Glitch in GetCrossReferenceItems
- From: zkid
- Re: Glitch in GetCrossReferenceItems
- From: Bear
- Re: Glitch in GetCrossReferenceItems
- Prev by Date: Re: Unneeded Languages In Documents
- Next by Date: Re: Making Word change appearance of certain words automatically
- Previous by thread: Re: Glitch in GetCrossReferenceItems
- Next by thread: RE: Change watermark via code
- Index(es):
Relevant Pages
|