Adjust the text and picture vertical alignment whenRVF Export Docx

General TRichView support forum. Please post your questions here
Post Reply
wolf1860
Posts: 118
Joined: Sat Nov 21, 2015 2:04 am

Adjust the text and picture vertical alignment whenRVF Export Docx

Post by wolf1860 »

I set the picture's valign = absMiddle, the displaying effect is perfect. But it will be changed to according to baseline after it is exported to docx, and I must open the docx and change the alignment property again with vba(comobject).Can u provide the saveAs Docx vertical alignment option or give me any advice?
This is my code to adjust the alignment:

Code: Select all

uses WordXp;

var wordDoc:TWordDocument;
begin
  ..............
  wordDoc.Select;  //Select all
  wordDoc.Application.Selection.ParagraphFormat.BaseLineAlignment := 1;  //set valign absMiddle
  wordDoc.Application.Selection.SetRange(0,0);//Deselect
end;
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Adjust the text and picture vertical alignment whenRVF Export Docx

Post by Sergey Tkachenko »

I am not sure how this option works (is it possible to assign it in MS Word UI?). But as I can see, this is a paragraph, not object property, so it cannot be used to represent image alignment.
wolf1860
Posts: 118
Joined: Sat Nov 21, 2015 2:04 am

Re: Adjust the text and picture vertical alignment whenRVF Export Docx

Post by wolf1860 »

OK,I do not know how the saveAs docx function work,Thanks again.
Post Reply