>> You can't. It is a holdover from the days before VBA when the method
>> of deleting a variable was to set it to a blank string. The nearest
[quoted text clipped - 3 lines]
> Well, nothing else remains so I will do like that. But why is the
> Word then saving variables with empty strings......

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
> Jan Kucera was telling us:
> Jan Kucera nous racontait que :
[quoted text clipped - 8 lines]
>
> A string containing a space is not an empty string... ;-)
I think the question Jan was asking is why, if when you set a Variable to an
empty string and it therefore disappears from the Variables collection in
VBA, does the tag of the Variable still appear with empty content when you
save the file as XML?
And I have no definite answer. I suspect it is a bug.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
Jan Kucera - 12 May 2006 11:26 GMT
> I think the question Jan was asking is why, if when you set a Variable to
> an empty string and it therefore disappears from the Variables collection
> in VBA, does the tag of the Variable still appear with empty content when
> you save the file as XML?
>
> And I have no definite answer. I suspect it is a bug.
Yes Jonathan, that was the question - thanks. ;-)
However you wrote a new information to me - when I set the variable to the
empty string, it will be deleted?
I was sooo near using Variables.Add("myVar", '") just to define it and set
later...
Jan
Jonathan West - 12 May 2006 11:56 GMT
>> I think the question Jan was asking is why, if when you set a Variable to
>> an empty string and it therefore disappears from the Variables collection
[quoted text clipped - 6 lines]
> However you wrote a new information to me - when I set the variable to the
> empty string, it will be deleted?
Yes. At least, it will disappear from the Variables collection in VBA. As
you have seen, the matching XML tag seems not to disappear.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
Jean-Guy Marcil - 12 May 2006 14:49 GMT
Jonathan West was telling us:
Jonathan West nous racontait que :
<snip>
>>> Well, nothing else remains so I will do like that. But why is the
>>> Word then saving variables with empty strings......
[quoted text clipped - 5 lines]
> Variables collection in VBA, does the tag of the Variable still
> appear with empty content when you save the file as XML?
Well done.
Your crystal ball is better than mine!

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org