Home > Back-end >  Ole, please operate word about how to realize the two text a left a right?
Ole, please operate word about how to realize the two text a left a right?

Time:09-22

For example, I want to be in the header part of the document name on the left, on the right shows the page number, the code is as follows:
 the Variant vSection=m_doc. OlePropertyGet (" Sections "). OleFunction (" Item ", 1); 
The Variant vHeader=vSection. OlePropertyGet (" Headers "). OleFunction (" Item ",
WdHeaderFooterPrimary);
The Variant vParagraph=vHeader. OlePropertyGet (" Range ").
OlePropertyGet (" Paragraphs ".) OleFunction (" Item ", 1);

The Variant vRange=vParagraph. OlePropertyGet (" Range ");
The Variant format=vRange. OlePropertyGet (" ParagraphFormat ");
Format. OlePropertySet (" Alignment ", wdAlignParagraphLeft);
The Variant endc=vRange. OlePropertyGet (" End ");
VRange. OlePropertySet (" End ", endc - 1);
VRange. OleFunction (" InsertBefore WideString (left));

VRange=vParagraph. OlePropertyGet (" Range ");
Endc=vRange. OlePropertyGet (" End ");
VRange. OleFunction (" SetRange, "endc endc);
Format=vRange. OlePropertyGet (" ParagraphFormat ");
Format. OlePropertySet (" Alignment ", wdAlignParagraphRight);
VRange. OleFunction (" InsertBefore WideString (right));


I want to first left, then right, but the all right. How aligned on the same line at the same time left to align right?