Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.tables
|
|||
|
|||
horizontally align table in ms word page
Hi all,
I have what I think must be an easy problem. I am creating lots of tables in an MW Word document, using C#. All of the tables appear centered on the document page except for one. It only has one column and the table appears aligned with the left margin. I have tried many things, but can't get it centered horizontally on the page. Please help, as I am losing my mind. How can I get the table centered horizontally on the page. Thanks much. Johnv |
#2
Posted to microsoft.public.word.tables
|
|||
|
|||
horizontally align table in ms word page
Check the table properties of one of the correctly centered tables (click in
the table and select Table Table Properties Table tab). The table can be aligned center by clicking the "Center" icon in the Alignment group. Alternatively, the table can be centered if you set text wrapping to "Around", click "Positioning" and select "Center" as the horizontal position. Note the settings applied to the table. Apply the same settings to the table that needs to be centered. In case of Word 2007, you can open the Table Properties dialog box from the leftmost group in the Layout tab that appears when your selection is in a table. -- Regards Lene Fredborg DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "JOHNV" wrote: Hi all, I have what I think must be an easy problem. I am creating lots of tables in an MW Word document, using C#. All of the tables appear centered on the document page except for one. It only has one column and the table appears aligned with the left margin. I have tried many things, but can't get it centered horizontally on the page. Please help, as I am losing my mind. How can I get the table centered horizontally on the page. Thanks much. Johnv |
#3
Posted to microsoft.public.word.tables
|
|||
|
|||
horizontally align table in ms word page
Hi Lene,
Thank you for the reply. I am sorry I was not very clear in my question. I am programmatically creating the tables, using c# and Word Interop. I have been able to do most everything in my code, but am having a problem with this one thing. I need to be able to programmatically adjust the table position, from the left edge to the middle, using c# instructions. For instance, there is a ParagraphFormat object available, but I have not been able to get the desired results with it. Thank you. Johnv "Lene Fredborg" wrote: Check the table properties of one of the correctly centered tables (click in the table and select Table Table Properties Table tab). The table can be aligned center by clicking the "Center" icon in the Alignment group. Alternatively, the table can be centered if you set text wrapping to "Around", click "Positioning" and select "Center" as the horizontal position. Note the settings applied to the table. Apply the same settings to the table that needs to be centered. In case of Word 2007, you can open the Table Properties dialog box from the leftmost group in the Layout tab that appears when your selection is in a table. -- Regards Lene Fredborg DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "JOHNV" wrote: Hi all, I have what I think must be an easy problem. I am creating lots of tables in an MW Word document, using C#. All of the tables appear centered on the document page except for one. It only has one column and the table appears aligned with the left margin. I have tried many things, but can't get it centered horizontally on the page. Please help, as I am losing my mind. How can I get the table centered horizontally on the page. Thanks much. Johnv |
#4
Posted to microsoft.public.word.tables
|
|||
|
|||
horizontally align table in ms word page
OK. I imagined you just wanted to make that final correction manually. In
VBA, you would need to manipulate the rows of the table to center the table. For example, the following line of code will center align the first table in the selection: Selection.Tables(1).Rows.Alignment = wdAlignRowCenter Maybe this can be used as a guide in your programming. -- Regards Lene Fredborg DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "JOHNV" wrote: Hi Lene, Thank you for the reply. I am sorry I was not very clear in my question. I am programmatically creating the tables, using c# and Word Interop. I have been able to do most everything in my code, but am having a problem with this one thing. I need to be able to programmatically adjust the table position, from the left edge to the middle, using c# instructions. For instance, there is a ParagraphFormat object available, but I have not been able to get the desired results with it. Thank you. Johnv "Lene Fredborg" wrote: Check the table properties of one of the correctly centered tables (click in the table and select Table Table Properties Table tab). The table can be aligned center by clicking the "Center" icon in the Alignment group. Alternatively, the table can be centered if you set text wrapping to "Around", click "Positioning" and select "Center" as the horizontal position. Note the settings applied to the table. Apply the same settings to the table that needs to be centered. In case of Word 2007, you can open the Table Properties dialog box from the leftmost group in the Layout tab that appears when your selection is in a table. -- Regards Lene Fredborg DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "JOHNV" wrote: Hi all, I have what I think must be an easy problem. I am creating lots of tables in an MW Word document, using C#. All of the tables appear centered on the document page except for one. It only has one column and the table appears aligned with the left margin. I have tried many things, but can't get it centered horizontally on the page. Please help, as I am losing my mind. How can I get the table centered horizontally on the page. Thanks much. Johnv |
#5
Posted to microsoft.public.word.tables
|
|||
|
|||
horizontally align table in ms word page
Yes! It works great! I was trying very hard to position the entire table
as a unit, instead of individual rows. I will need to train my mind to "think inside the box". I noticed when Suzanne Barnhill solved a problem on this site recently, she received a poem in payment. Since I am not a poet, please just accept my THANK YOU! Johnv "Lene Fredborg" wrote: OK. I imagined you just wanted to make that final correction manually. In VBA, you would need to manipulate the rows of the table to center the table. For example, the following line of code will center align the first table in the selection: Selection.Tables(1).Rows.Alignment = wdAlignRowCenter Maybe this can be used as a guide in your programming. -- Regards Lene Fredborg DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "JOHNV" wrote: Hi Lene, Thank you for the reply. I am sorry I was not very clear in my question. I am programmatically creating the tables, using c# and Word Interop. I have been able to do most everything in my code, but am having a problem with this one thing. I need to be able to programmatically adjust the table position, from the left edge to the middle, using c# instructions. For instance, there is a ParagraphFormat object available, but I have not been able to get the desired results with it. Thank you. Johnv "Lene Fredborg" wrote: Check the table properties of one of the correctly centered tables (click in the table and select Table Table Properties Table tab). The table can be aligned center by clicking the "Center" icon in the Alignment group. Alternatively, the table can be centered if you set text wrapping to "Around", click "Positioning" and select "Center" as the horizontal position. Note the settings applied to the table. Apply the same settings to the table that needs to be centered. In case of Word 2007, you can open the Table Properties dialog box from the leftmost group in the Layout tab that appears when your selection is in a table. -- Regards Lene Fredborg DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "JOHNV" wrote: Hi all, I have what I think must be an easy problem. I am creating lots of tables in an MW Word document, using C#. All of the tables appear centered on the document page except for one. It only has one column and the table appears aligned with the left margin. I have tried many things, but can't get it centered horizontally on the page. Please help, as I am losing my mind. How can I get the table centered horizontally on the page. Thanks much. Johnv |
#6
Posted to microsoft.public.word.tables
|
|||
|
|||
horizontally align table in ms word page
Thank you for the feedback. I am glad that I could help.
Note that it is often helpful to try recording a macro in order to find out how Word handles an operation. The code is not always elegant but you will very often get an idea of in which direction to go. Actually, that was what I did in this case - I never center align tables... -- Regards Lene Fredborg DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "JOHNV" wrote: Yes! It works great! I was trying very hard to position the entire table as a unit, instead of individual rows. I will need to train my mind to "think inside the box". I noticed when Suzanne Barnhill solved a problem on this site recently, she received a poem in payment. Since I am not a poet, please just accept my THANK YOU! Johnv "Lene Fredborg" wrote: OK. I imagined you just wanted to make that final correction manually. In VBA, you would need to manipulate the rows of the table to center the table. For example, the following line of code will center align the first table in the selection: Selection.Tables(1).Rows.Alignment = wdAlignRowCenter Maybe this can be used as a guide in your programming. -- Regards Lene Fredborg DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "JOHNV" wrote: Hi Lene, Thank you for the reply. I am sorry I was not very clear in my question. I am programmatically creating the tables, using c# and Word Interop. I have been able to do most everything in my code, but am having a problem with this one thing. I need to be able to programmatically adjust the table position, from the left edge to the middle, using c# instructions. For instance, there is a ParagraphFormat object available, but I have not been able to get the desired results with it. Thank you. Johnv "Lene Fredborg" wrote: Check the table properties of one of the correctly centered tables (click in the table and select Table Table Properties Table tab). The table can be aligned center by clicking the "Center" icon in the Alignment group. Alternatively, the table can be centered if you set text wrapping to "Around", click "Positioning" and select "Center" as the horizontal position. Note the settings applied to the table. Apply the same settings to the table that needs to be centered. In case of Word 2007, you can open the Table Properties dialog box from the leftmost group in the Layout tab that appears when your selection is in a table. -- Regards Lene Fredborg DocTools - Denmark www.thedoctools.com Document automation - add-ins, macros and templates for Microsoft Word "JOHNV" wrote: Hi all, I have what I think must be an easy problem. I am creating lots of tables in an MW Word document, using C#. All of the tables appear centered on the document page except for one. It only has one column and the table appears aligned with the left margin. I have tried many things, but can't get it centered horizontally on the page. Please help, as I am losing my mind. How can I get the table centered horizontally on the page. Thanks much. Johnv |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I have 'align left' and 'align centre' on tool bar I need align ri | Microsoft Word Help | |||
How can I horizontally split a table (in WORD) into two tables? | Tables | |||
How do I divide a page into four; horizontally and vertically? | Microsoft Word Help | |||
Divide page vertically and horizontally | Microsoft Word Help | |||
excel table in a page of a word document, horizontally | Page Layout |