Page 1 of 1

Adjust the text and picture vertical alignment whenRVF Export Docx

Posted: Sat Oct 14, 2017 6:51 am
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;

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

Posted: Sat Oct 14, 2017 8:43 am
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.

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

Posted: Sat Oct 14, 2017 8:46 am
by wolf1860
OK,I do not know how the saveAs docx function work,Thanks again.