Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

Paragraph alignment does not work

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cloe - 14 Feb 2005 08:17 GMT
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)

:((((((((
Please advise
Guy
Jezebel - 14 Feb 2005 10:41 GMT
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

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.