Hi all.
I use VB6 to create a Word document from an existing "template" I made.
This is a piece of the code:
Set wField = WordDoc.Fields(WordDoc.Variables("strReportHeader1").Index)
Set wRange = wField.Code
wRange.ParagraphFormat.Alignment = IIf(RTL, wdAlignParagraphRight,
wdAlignParagraphLeft)
The code does not align the text to the right (IIF returns 2,which is
wdAlignParagraphRight)
First, selecting a field by relying on the index of your particular
docvariable seems obtuse, to say the least. The index numbers of your
DocVariables is just an artefact of the order in which you create them,
added to any that happen to be in your document already. Are you sure that
you're aligning the right paragraph, and how would you know? (And out of
curiosity, why such a bizarre approach?) -- Or do you in fact intend the
VALUE of the variable, rather than its Index?
Second, you're applying the alignment to the field code, when you should be
applying to the paragraph that contains that code.
Third, what is RTL ?
> Hi all.
> I use VB6 to create a Word document from an existing "template" I made.
[quoted text clipped - 12 lines]
> Please advise
> Guy
Cloe - 14 Feb 2005 12:20 GMT
Hi J,
RTL=RightToLeft.
I fixed the problem by using the values rather than the constants. I had
this problem before and I just forgot about it.
Thank you!
G
> First, selecting a field by relying on the index of your particular
> docvariable seems obtuse, to say the least. The index numbers of your
[quoted text clipped - 25 lines]
>> Please advise
>> Guy