Leykis101 Posted January 9, 2008 Posted January 9, 2008 I have created a Microsoft word document. Then I output data into a table, I would like to set the alignment of each column (Vertical AND Horizontal). I cannot figure out how to do this. Any help would be greatly appreciated. I have searched msdn for hours and cannot figureo ut how to use the .Alignment properties. Thanks Neither of the last 2 lines of this code did anything for me. $oTable.cell(2+_GUICtrlListViewGetItemCount ( $lvItems ), 3).Range.Text = "SUBTOTAL" $oTable.cell(2+_GUICtrlListViewGetItemCount ( $lvItems ), 4).Range.Text = GUICtrlRead ( $lblLineItemsSubtotal ) $oTable.cell(2+_GUICtrlListViewGetItemCount ( $lvItems ), 6).Range.Text = GUICtrlRead ( $lblProfitSubtotal ) $oTable.cell(2+_GUICtrlListViewGetItemCount ( $lvItems ), 7).Range.Text = GUICtrlRead ( $lblTotalSubtotal ) $oTable.cell(3+_GUICtrlListViewGetItemCount ( $lvItems ), 3).Range.Text = "SALES TAX" $oTable.cell(3+_GUICtrlListViewGetItemCount ( $lvItems ), 7).Range.Text = GUICtrlRead ( $lblTotalSalesTax ) $oTable.cell(4+_GUICtrlListViewGetItemCount ( $lvItems ), 3).Range.Text = "TOTAL" $oTable.cell(4+_GUICtrlListViewGetItemCount ( $lvItems ), 7).Range.Text = GUICtrlRead ( $lblTotalTotal ) $oTable.Rows.Item(1).Range.Font.Bold = True $oTable.Range.Font.Size = 8.5 $oTable.Rows.Item(1).Range.Font.Size = 7.5 $oTable.Range.Font.Name = "Trebuchet MS" $oTable.Columns.Item(1).Width = $oWordProfits.InchesToPoints("0.54") $oTable.Columns.Item(2).Width = $oWordProfits.InchesToPoints("2.16") $oTable.Columns.Item(3).Width = $oWordProfits.InchesToPoints("0.88") $oTable.Columns.Item(4).Width = $oWordProfits.InchesToPoints("1.08") $oTable.Columns.Item(5).Width = $oWordProfits.InchesToPoints("0.84") $oTable.Columns.Item(6).Width = $oWordProfits.InchesToPoints("0.77") $oTable.Columns.Item(7).Width = $oWordProfits.InchesToPoints("0.7") $oTable.Columns.Item(1).Alignment = "3" $oTable.Columns.Item(1).HorizontalLineFormat.Alignment = "wdHorizontalLineAlignRight"
Squirrely1 Posted January 30, 2008 Posted January 30, 2008 (edited) The first maybe useful thing to come to mind is that perhaps the .Alignment property is read-only. But the latest release version of AutoIt does come with many Word Management UDF's. Have you looked in the AutoIt Help file: Help file > User Defined Functions > Word Management If you ever put any of those functions in your AutoIt script, be sure to have this line near the top of your AutoIt script: #include <Word.au3> Edited January 30, 2008 by Squirrely1 Das Häschen benutzt Radar
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now