Solved

Center the text or a picture using WordDocument

Posted on 2004-09-25
3
273 Views
Last Modified: 2010-04-05
I have one more question about  manipulating MS Word ... i want to make some text or a picture be  centered in a table cell .. or just in a Range somewhere. How can i do that?
0
Comment
Question by:bipbip86
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
mokule earned 125 total points
ID: 12151110
Hi,
The best practice in all such situations is to create new macro.
Do needed operations. Look into the macro. Do the same in Delphi.
0
 

Author Comment

by:bipbip86
ID: 12152166
Well yes, i found out how to do it. Just in case someone else searches for it, to center the text in a table cell:

WordDocument.Tables.Item(1).Cell(1, 1).Range.Document.Paragraphs.Last.Alignment:=wdAlignParagraphCenter;

to center the content vertically:
WordDocument.Tables.Item(1).Cell(1, 1).VerticalAlignment;

well ,that's it.
 -bipbip.
0
 

Author Comment

by:bipbip86
ID: 12152191
... the last line should be
          WordDocument.Tables.Item(i + 1).Cell(1, 1).VerticalAlignment:=wdCellAlignVerticalCenter;
my mistake.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question