Solved

Center the text or a picture using WordDocument

Posted on 2004-09-25
3
265 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
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
mokule earned 125 total points
Comment Utility
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
Comment Utility
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
Comment Utility
... the last line should be
          WordDocument.Tables.Item(i + 1).Cell(1, 1).VerticalAlignment:=wdCellAlignVerticalCenter;
my mistake.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now