JTextPane vertical align center

Hello,
In an swing application a user can edit fixed sized labels. The labels are JTextPane.
I need to implement the possibility of the centering the text vertical in the JTextPane.
This problem is solved in topic:
http://forum.java.sun.com/thread.jspa?forumID=57&threadID=687270
My problem is that implementing like this the other text formatters are dissapearing (StyleConstants, Font.BOLD, Font.Italic, etc.).
Is it a way to extend StyedEditorKit in order to keep the formatters?
Many thanks
Bogdan

Well, no, but that's not really relevant - or rather, and I'll get back to this, it's a different interpretation of margins.
What I mean is, let's take that Word example, if we're talking about a 'page' (ie a white rectangle) you can have a JPanel whose background is white. This has a layout which plases the child component in the centre vertically and expanded to the width horizontally. Your JTextPane is that child, and it is non-opaque.
What this equates to is a JPanel which is the page or document itself and a JTextPane which is the text content on it. In the context of something along the lines of the Word document, you might think of it as the JTextPane being the document as input by the user, the JPanel being the paper on which they want to print, and the layout as being the margins (which in this case are 'automatic' at top and bottom rather than just being static sizes). If anything I think that's actually a better metaphor for page editing than just the JTextPane on its own :o)

Similar Messages

  • "Vertical Align Center" Text and a Shape

    Hi designers,
    I wonder if anyone could give me a hand with aligning text and shapes? I would like to align a number to the center of a circle. "Horizontal Align Center" works well. "Vertical Align Center", however, does not yield the desired result. The number turns out to be higher in the cycle (see figure below). The distance from the top of the circle to the top of the number zero, X, is shorter than the distance between the bottom of the circle and the bottom of the number zero. Is it possible to equal these two distances?
    Figure 1: The Outcome of Vertical Align Center
    Thanks,
    Haobo

    Hi Mylenium,
    Thank you very much for you very prompt reply, which solves the problem very effectively.
    If you do not mind, I have got two further questions.
    Firstly, is there an option similar to "Align to Path: Centre" under "Type on a Path Options" that changes how text is aligned?
    Secondly, does InDesign offer the aforementioned function?
    I sometimes label a large quantity of locations with alphanumeric characters, which are subject to frequent changes, and therefore would like to preserve the text if possible. I have heard that manipulating text is InDesign's area of expertise. If this function is not available in Illustrator but offered by InDesign, I can jot down another reason for acquiring the latter and split the workflow in the future.
    Thanks,
    Haobo

  • Why does Vertical Align Center align objects along the horizontal?

    And why does Horizontal Align Center align objects along the vertical?
    -g-
    P.S. Please please please make the Eydropper tool available by function key so I can toggle to it while using the Text tool. Please!

    g,
    but when I select two objects and click the vertical align button they snap to an invisible horizontal line
    This is (almost) identical to:
    Because (the centres of) vertically aligned objects will be on the same horizontal level/line.
    And that is just one way of expressing what vertical alignment means. Here are a few others:
    Their centres have the same height,
    Their centres have the same Y value on the Artboard/Workspace,
    In all cases, you can draw a horizontal line through their centres.
    Mathematically, Y = C (Y is a constant value C) is the equation for a horizontal line.

  • "horizontal/vertical align center" relative to one object, not the average

    Hello!
    I see in Illustrator, if i select 2 objects and i choose to align them relative to their centers, both objects will move to the middle point of the distance between their original positions.
    Is there a way to make just one of them move?
    Am i able to center one object to another object that is already in its final position?
    thanks a lot!

    i tried it, but it doesn't work. here's what i did:
    -selected one object
    -shift-selected the other one
    -clicked horizontal align center
    both objects moved
    (i am using CS3)

  • Vertical alignment in cross-tab

    Hi,
    Anyone of you know how to align the measures Vertically Centered In Cross-tab report? As far as i know, there is option for Horizontal alignment; but no options for Vertical alignment. By default the text are docking on top aligned!!!
    Help me out to solve this or any work-around to achieve this?
    Thanks in Advance
    Viswa

    Hey Anindita,
    I was not asking about the text orientation. I want to align the text in the cross tab report to be vertically aligned center.
    I want the text in each cell should be aligned centered both horizontally as well as vertically. Horizontal alignment is available in cross tab formatting but not for the vertical alignment.
    Thanks
    Viswa

  • BO XIR2 SP3 FP3.3 - vertical alignment of 1st column of 2nd page ignored

    We have webi reports that have all cells set to vertical alignment bottom. If the report spans more than one page, the first column of the second page reverts to vertical alignment center for all cells in the column. All other columns remain with bottom vertical alignment. This problem does not occur in PDF view, only in HTML views. Does anyone know if there is a fix for this? Can I modify a file somewhere in the system to fix a missing vertical alignment tag?
    Joe Gottschall
    Pixstar, Inc.

    Yes, there is "sort-of":
    Object > Text Frame Options ( Ctrl + B )
    Vertical Justification, set Align to "Justify".
    It won't distribute evenly across all three columns though... in other words InDesign doesn't balance the text across the three columns with this feature.
    Instead it pushes space between lines/paragraphs within each column to ensure the top and bottom line of text in each column are lined up with top and bottom of text frame.
    If there is only a little bit of text in the last column, things might not look like you anticipated.

  • Vertical align to center in a div

    Hi,
    I'm putting together a css layout in dreamweaver CS3, i have a basic nav bar with a solid black colour with text on top. I'm trying to vertical align the text to the center, currently it's center horizontally, but the text is right at the top of the div. The only way i've been able to change the position is to use "line height"
    Any there any easy way to do this in css?
    Any help is much appreciated, thanks.

    Hi again,
    I'm having a bit of trouble trying to get my main text area vertically center on one of my pages, i have a two column layout(text area on the right). The above methods don't seem to work, they just seem expand my whole bodyArea downwards.
    Currently my codes look like this:
    Layout:
    <style type="text/css">
    <!--
    body {
         background-color: #666666;
    #wrapper #bodyArea #left {
         background-image: url(images/picture.jpg);
         float: left;
         background-repeat: no-repeat
    -->
    </style></head>
    <body>
    <div id="wrapper">
      <div id="logo"></div>
      <div id="nav"><a href= nav text here </a></div>
      <div id="bodyArea">
        <div id="left"></div>
        <div id="shadow"></div>
        <div id="right">text with paragraphs here</div>
        <div id="footer">copyright info here</div>
      </div>
    </div>
    </body>
    </html>
    stylesheet:
    #wrapper {
         width: 781px;
         margin-right: auto;
         margin-left: auto;
            height: 699px;
    #wrapper #logo {
         height: 116px;
            background-image: url(../images/logo.jpg);
    #wrapper #nav {
         height: 38px;
         text-align: center;
         color: #FFFFFF;
         font-family: "Courier New", Courier, monospace;
         font-size: 19px;
         line-height: 38px;
         background-repeat: no-repeat;
         background-color: #000000;
         margin: 0px;
    #wrapper #bodyArea #left {
         width: 341px;
         float: left;
         height: 507px;
    #wrapper #bodyArea #right {
         width: 440px;
         float: right;
         height: 507px;
         text-align: center;
         color: #000000;
         vertical-align: middle;
         font-family: Arial, Helvetica, sans-serif;
         font-size: 16px;
    #wrapper #bodyArea #right #shadow {
         height: 14px;
         background-image: url(../images/shadow.gif);
         background-repeat: repeat-x;
    #wrapper #bodyArea #footer {
         height: 38px;
         clear: both;
         text-align: center;
         color: #FFFFFF;
         background-color: #000000;
         font-family: Arial, Helvetica, sans-serif;
         font-size: 15px;
         line-height: 38px;
         margin: 0px;
    p {
         margin-top: 0px;
         margin-right: 10px;
         margin-bottom: 15px;
         margin-left: 10px;
    I'm fairly new to CSS layouts, if anyone could help me it would be much appreciated, thanks.

  • Align Center Horizontal & Center Vertical Backwards

    Align "center horizontal" centers vertically and "center vertical" works horizontally in CS5.  Is this an undocumented feature????

    I am using the dropdown "Modify" then"Align".

  • How do I vertically align paragraphs in a page?

    I am new to Pages, and I've run across a problem that is really aggravating because it should not be rocket science... but it seems to be, at least for me.
    I need to center the text on the page so there is equal white space above and below it.
    In Word, you select File --> Page Setup --> Layout --> Vertical Alignment and choose "Center." Done.
    How do you do this Pages? I've scoured the manual and online help and can find nothing on this.
    Thanks in advance!

    Note that the Vertical Alignment does not apply to the Text Layer of a Word Processing document, just to the text in objects that accept text within the shape. For your application you would probably want to add a text box, centered on your page, to hold the text that you want to center.
    Regards,
    Jerry
    Message was edited by: Jerrold Green1

  • Unable to vertical align flash file

    I have previously posted this on the Dreamweaver forum, however, have not been able to obtain a response.
    I have been attempting to align a flash file created with FC in the center of a web browser with CSS.  The file is 800 x 600 px and I was hoping to centre the file using CSS.
    I have created a Div Tag wrapper around the .swf and can get the file to center horizontally, however, the file will not move from the top of the browser.
    I would prefer not to use tables, and would like to keep the file simple with CSS.
    Any suggestions would be appreciated.
    JB

    Yes it is a bit tricky to vertically align content. Take a look at this example that shows you how to setup your <div> containers. 
    http://www.webtoolkit.info/css-vertical-align.html
    Hope this works for you.
    Tanya

  • Vertical alignment off in table columns

    I have a table with 3 columns with one row above and below
    Text in left and right column is aligned to the top but in
    the middle column the text will not align to the top. In IE it is
    correct but in Firefox 1.6 it is down by 1 line
    How to correct?
    David
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN" "
    http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
    <HTML
    xmlns="
    http://www.w3.org/1999/xhtml"><HEAD><TITLE>BustedComputer</TITLE>
    <META http-equiv=Content-Type content="text/html;
    charset=iso-8859-1" />
    <style type="text/css">
    <!--
    body {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11pt;
    color: #000000;
    margin-left: 0px;
    margin-top: 0px;
    table, td
    border-color: #000000;
    border-style: solid;
    table
    border-width: 0 0 1px 1px;
    border-spacing: 0;
    border-collapse: collapse;
    td
    margin: 0;
    padding: 10px;
    border-width: 1px 1px 0 0;
    vertical-align: top;
    a:link { color: blue; text-decoration: none }
    a:active { color: blue; text-decoration: none }
    a:visited { color: #0000FF; text-decoration: none }
    a:hover { color: blue; background-color:#FFFF9D;
    text-decoration: underline }
    -->
    </style>
    </HEAD>
    <BODY>
    <TABLE cellSpacing=0 cellPadding=0 width=800 align=center
    border=0>
    <TBODY>
    <TR>
    <TD colSpan=3 bgcolor="#6699FF">Top</TD>
    </TR>
    <TR>
    <TD width="150" bgcolor="#6699FF"><a
    href="#">leftside</a></TD>
    <TD bgcolor="#FFFFCC"><p>Contrary to popular
    belief, Lorem Ipsum is not simply
    random text. It has roots in a piece of classical Latin
    literature from
    45 BC, making it over 2000 years old.<br>
    <br>
    Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de
    Finibus
    Bonorum et Malorum" (The Extremes of Good and Evil) by
    Cicero, written
    in 45 BC. This book is a treatise on the theory of ethics,
    very popular
    during the Renaissance. The first line of Lorem Ipsum,
    "Lorem ipsum dolor
    sit amet..", comes from a line in section 1.10.32.</p>
    </TD>
    <TD width="150" bgcolor="#FFFFCC">rightside</TD>
    </TR>
    <TR>
    <TD colSpan=3 bgcolor="#6699FF">Bottom</TD>
    </TR></TBODY></TABLE></BODY></HTML>

    Could it be that you are seeing the top margin on the
    <p> tag?
    <TD bgcolor="#FFFFCC"><p>Contrary to popular
    belief
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "davidhelp" <[email protected]> wrote in
    message
    news:[email protected]...
    >I have a table with 3 columns with one row above and
    below
    > Text in left and right column is aligned to the top but
    in the middle
    > column
    > the text will not align to the top. In IE it is correct
    but in Firefox 1.6
    > it
    > is down by 1 line
    >
    > How to correct?
    >
    > David
    >
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN"
    > "
    http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
    > <HTML
    > xmlns="
    http://www.w3.org/1999/xhtml"><HEAD><TITLE>BustedComputer</TITLE>
    > <META http-equiv=Content-Type content="text/html;
    charset=iso-8859-1" />
    > <style type="text/css">
    > <!--
    > body {
    > font-family: Verdana, Arial, Helvetica, sans-serif;
    > font-size: 11pt;
    > color: #000000;
    > margin-left: 0px;
    > margin-top: 0px;
    >
    > }
    > table, td
    > {
    > border-color: #000000;
    > border-style: solid;
    > }
    > table
    > {
    > border-width: 0 0 1px 1px;
    > border-spacing: 0;
    > border-collapse: collapse;
    > }
    > td
    > {
    > margin: 0;
    > padding: 10px;
    > border-width: 1px 1px 0 0;
    > vertical-align: top;
    > }
    > a:link { color: blue; text-decoration: none }
    > a:active { color: blue; text-decoration: none }
    > a:visited { color: #0000FF; text-decoration: none }
    > a:hover { color: blue; background-color:#FFFF9D;
    text-decoration:
    > underline }
    >
    > -->
    > </style>
    > </HEAD>
    > <BODY>
    > <TABLE cellSpacing=0 cellPadding=0 width=800
    align=center border=0>
    > <TBODY>
    > <TR>
    > <TD colSpan=3 bgcolor="#6699FF">Top</TD>
    > </TR>
    > <TR>
    > <TD width="150" bgcolor="#6699FF"><a
    href="#">leftside</a></TD>
    > <TD bgcolor="#FFFFCC"><p>Contrary to popular
    belief, Lorem Ipsum is
    > not
    > simply
    > random text. It has roots in a piece of classical Latin
    literature
    > from
    > 45 BC, making it over 2000 years old.<br>
    > <br>
    > Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of
    "de Finibus
    > Bonorum et Malorum" (The Extremes of Good and Evil) by
    Cicero,
    > written
    > in 45 BC. This book is a treatise on the theory of
    ethics, very
    > popular
    > during the Renaissance. The first line of Lorem Ipsum,
    "Lorem
    > ipsum
    > dolor
    > sit amet..", comes from a line in section
    1.10.32.</p>
    > </TD>
    > <TD width="150"
    bgcolor="#FFFFCC">rightside</TD>
    > </TR>
    > <TR>
    > <TD colSpan=3 bgcolor="#6699FF">Bottom</TD>
    >
    </TR></TBODY></TABLE></BODY></HTML>
    >
    >

  • Can table cell vertical alignment be defined via CSS?

    In a table cell (ie, "td") is there a way to define "valign" via CSS, instead of the table cell proper?
    In other words, instead of...
    <table>
    <tr>
    <td valign="top">
    ...is it possible to do :
    <table>
    <tr>
    <td class="top">
    ...and somehow let the stylesheet define the vertical alignment?
    I'm asking because none of the attribute presets in Dreamweaver CS4 seem to provide for vertical alignment. Everything else on God's green earth seems to be there, but table cell vertical alignment seems to be the ONLY thing CSS forgot about.

    How about giving the class "top": text-align:center. Or even the tag "td" in your stylesheet. Does that help?
    John

  • CSS vertical-align problem

    I cant figure out why the valign isnt working on my page..
    http://www.v4.skiingbc.info/pages/skiarea2.php?Name=Test1212&TrailMaps=X&FS=√&LP=√
    CSS Sheet:
    http://v4.skiingbc.info/v4.css
    I want all text to be middle aligned in the table cells... If
    someone could take a look at the code that would be really
    appreciated..
    In Dreamweaver the text is middle aligned, it just doesnt
    work in IE7

    You have this on the page:
    <td height="79"
    <valign="top">
    try changing it to thos:
    <td height="79" valign="top">
    you also have this:
    <option selected="selected">Select Card
    Type</option>
    option selected>Search By Card Type
    </option>
    make it like this:
    <option selected="selected">Select Card
    Type</option>
    Ken Ford
    Adobe Community Expert
    Fordwebs, LLC
    http://www.fordwebs.com
    "Monica101" <[email protected]> wrote in
    message news:f0foos$n7u$[email protected]..
    > I've got text in a table that won't align at the top:
    >
    > <td height="79"valign="top"><table width="150"
    border="0" cellpadding="0"
    > cellspacing="0" class="Side_Links">
    >
    > It looks fine in Dreamweaver, but displays verticaly in
    the center of the
    > table. I've been working in Dreamweaver for years and
    never had this problem. I
    > tried fixing it w/ css:
    >
    > vertical-align: top;
    >
    > This didn't work either.
    >
    > Page:
    >
    >
    http://www.capitalinternet.com/~mycredit/template.php
    >
    > Thanks!
    >
    >

  • VERTICAL ALIGNMENT ON WORD TABLE IS MISS.

    Hello everybody,
    Can somebody clear my mind? I did the code below, and this generates a beautiful and clean table on word 2010. The problem is that the instruction “.Rows.Height = 8” and 
    “.Cells.VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter” seems
     not work, besides, when I try to adjust the rows height and vertical alignment by myself, after routine generates the table of course, Word don´t allow me to do these adjustment by hand.
    The property “.Rows.Height = 8” seems to be working, because when I change to “.Rows.Height = 25” the rows height really goes to it, also, there is no problem with horizontal alignment, this is work very fine.
    Working with VS 2012 and Word 2010.
    Tried everything, no result….
    Thank you.
    Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
    Dim WA As New Word.Application
    Dim WD As Word.Document
    Dim WS As Word.Selection
    Dim model_address, mes_extenso, texto, texto_ref, pic_address As String
    model_address = Application.StartupPath & "\GTMS_MDL.docx"
    pic_address = Application.StartupPath & "\PIC\TABELA01.png"
    WD = WA.Documents.Open(model_address, [ReadOnly]:=True)
    WS = WA.Selection
    Dim WT1 As Word.Table
    Dim WR1 As Word.Range
    Dim lin_wt1, lin_wt2, lin_wt3 As Integer
    lin_wt1 = 3
    WT1 = WD.Tables.Add(WA.Selection.Range, lin_wt1 + 2, 5)
    With WT1.Range
    .ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter
    .Cells.VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalBottom
    .Rows.Shading.BackgroundPatternColor = Word.WdColor.wdColorAqua
    .Rows(1).Shading.BackgroundPatternColor = Word.WdColor.wdColorBlueGray
    .Rows.Borders.OutsideLineStyle = Word.WdLineStyle.wdLineStyleSingle
    .Columns.Borders.InsideLineStyle = Word.WdLineStyle.wdLineStyleSingle
    .Font.Bold = True
    .Font.ColorIndex = Word.WdColorIndex.wdWhite
    .Rows.Height = 8
    .Columns(1).Width = 30
    .Columns(2).Width = 350
    .Columns(3).Width = 40
    .Columns(4).Width = 50
    .Columns(5).Width = 50
    .Font.Size = 7
    End With
    WT1.Range.Text = ""
    WT1.Cell(1, 1).Range.Text = "ITEM"
    WT1.Cell(1, 2).Range.Text = "DESCRIÇÃO"
    WT1.Cell(1, 3).Range.Text = "QTD."
    WT1.Cell(1, 4).Range.Text = "UNIT."
    WT1.Cell(1, 5).Range.Text = "SUBTOTAL"
    For i = 0 To lin_wt1
    WT1.Cell(i + 1, 2).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft
    Next
    For i = 0 To lin_wt1 - 1
    WT1.Cell(i + 2, 1).Range.Text = i + 1
    WT1.Cell(i + 2, 2).Range.Text = DGV1.Rows(i).Cells(2).Value
    WT1.Cell(i + 2, 3).Range.Text = DGV1.Rows(i).Cells(3).Value
    WT1.Cell(i + 2, 4).Range.Text = DGV1.Rows(i).Cells(4).Value
    WT1.Rows(i + 2).Range.Font.ColorIndex = Word.WdColorIndex.wdBlack
    WT1.Rows(i + 2).Range.Font.Bold = False
    Next
    WT1.Cell(lin_wt1 + 2, 1).Merge(WT1.Cell(lin_wt1 + 2, 2))
    WT1.Cell(lin_wt1 + 2, 2).Merge(WT1.Cell(lin_wt1 + 2, 4))
    WT1.Cell(lin_wt1 + 2, 1).Range.Text = "TOTAL GERAL"
    WT1.Rows(lin_wt1 + 2).Range.Font.ColorIndex = Word.WdColorIndex.wdDarkRed
    WT1.Rows(lin_wt1 + 2).Range.Font.Size = 10
    WT1.Cell(lin_wt1 + 2, 1).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft
    WT1.Cell(lin_wt1 + 2, 2).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter
    WT1.Cell(lin_wt1 + 2, 2).Range.Text = FormatCurrency(12560, 2)
    WA.Visible = True
    WA = Nothing
    WD = Nothing
    WS = Nothing
    End Sub

    Hi,
    >>The problem is that the instruction “.Rows.Height = 8” and 
    “.Cells.VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter” seems
     not work, besides, when I try to adjust the rows height and vertical alignment by myself, after routine generates the table of course, Word don´t allow me to do these adjustment by hand.
    The property “.Rows.Height = 8” seems to be working, because when I change to “.Rows.Height = 25” the rows height really goes to it, also, there is no problem with horizontal alignment, this is work very fine<<
    I am not able to understand the issue exactly. Can you set the height for the rows using Rows.Height? I made a quick test using VBA based on the code above, it works well for me. And I can also adjust by hand after run the code.
    >> “.Cells.VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter” seems
     not work<<
    What effect did you want to achieve? Based on the code samlpe you were setting the verical alignment to bottom however the description are center. Both center and bottom for the vertical alignment works well for me.
    I would suggest that you test the code using a new document to see whether the issue is realtive to the specific document. Here is the test code in VBA for your reference:
    Sub test()
    Dim WA As New Word.Application
    WA.Visible = True
    Dim WD As Word.Document
    Dim WS As Word.Selection
    Dim model_address, mes_extenso, texto, texto_ref, pic_address As String
    'model_address = Application.StartupPath & "\GTMS_MDL.docx"
    model_address = "C:\doc1.docx"
    'pic_address = Word.Application.StartupPath & "\PIC\TABELA01.png"
    Set WD = WA.Documents.Open(model_address, ReadOnly:=True)
    Set WS = WA.Selection
    Dim WT1 As Word.Table
    Dim WR1 As Word.Range
    Dim lin_wt1, lin_wt2, lin_wt3 As Integer
    lin_wt1 = 3
    Set WT1 = WD.Tables.Add(WA.Selection.Range, lin_wt1 + 2, 5)
    With WT1.Range
    .ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter
    .Cells.VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter
    .Rows.Shading.BackgroundPatternColor = Word.WdColor.wdColorAqua
    .Rows(1).Shading.BackgroundPatternColor = Word.WdColor.wdColorBlueGray
    .Rows.Borders.OutsideLineStyle = Word.WdLineStyle.wdLineStyleSingle
    .Columns.Borders.InsideLineStyle = Word.WdLineStyle.wdLineStyleSingle
    .Font.Bold = True
    .Font.ColorIndex = Word.WdColorIndex.wdWhite
    .Rows.Height = 8
    .Columns(1).Width = 30
    .Columns(2).Width = 350
    .Columns(3).Width = 40
    .Columns(4).Width = 50
    .Columns(5).Width = 50
    .Font.Size = 7
    End With
    WT1.Range.Text = ""
    WT1.Cell(1, 1).Range.Text = "ITEM"
    WT1.Cell(1, 2).Range.Text = "DESCRI??O"
    WT1.Cell(1, 3).Range.Text = "QTD."
    WT1.Cell(1, 4).Range.Text = "UNIT."
    WT1.Cell(1, 5).Range.Text = "SUBTOTAL"
    For i = 0 To lin_wt1
    WT1.Cell(i + 1, 2).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft
    Next
    For i = 0 To lin_wt1 - 1
    WT1.Cell(i + 2, 1).Range.Text = i + 1
    WT1.Cell(i + 2, 2).Range.Text = "a" 'DGV1.Rows(i).Cells(2).Value
    WT1.Cell(i + 2, 3).Range.Text = "b" 'DGV1.Rows(i).Cells(3).Value
    WT1.Cell(i + 2, 4).Range.Text = "c" 'DGV1.Rows(i).Cells(4).Value
    WT1.Rows(i + 2).Range.Font.ColorIndex = Word.WdColorIndex.wdBlack
    WT1.Rows(i + 2).Range.Font.Bold = False
    Next
    WT1.Cell(lin_wt1 + 2, 1).Merge WT1.Cell(lin_wt1 + 2, 2)
    WT1.Cell(lin_wt1 + 2, 2).Merge WT1.Cell(lin_wt1 + 2, 4)
    WT1.Cell(lin_wt1 + 2, 1).Range.Text = "TOTAL GERAL"
    WT1.Rows(lin_wt1 + 2).Range.Font.ColorIndex = Word.WdColorIndex.wdDarkRed
    WT1.Rows(lin_wt1 + 2).Range.Font.Size = 10
    WT1.Cell(lin_wt1 + 2, 1).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft
    WT1.Cell(lin_wt1 + 2, 2).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter
    WT1.Cell(lin_wt1 + 2, 2).Range.Text = FormatCurrency(12560, 2)
    WA.Visible = True
    Set WA = Nothing
    Set WD = Nothing
    Set WS = Nothing
    End Sub
    Hope it is helpful.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Setting Vertical alignment

    I know how to set vertical alignment in a Microsoft Word document.
    I have been unable to find out how to do the same thing in Pages '08.
    I know it has to be there because if I open a document in Pages that was created with Microsoft Word that has vertical alignment set to center it is recognized by Pages.
    Any suggestions??
    Peter

    I do not think it is available through the UI. The way to add vertical alignment to a page is to copy a page from a converted Word document and paste it to your Pages document.
    It does not seem like Pages XML is currently fully documented, even though it has been claimed to be. I thought it would be here but that is not for the current version, and it is incomplete.
    I would guess it is this kind of information:
    <pre>
    <sf:verticalAlignment>
    <sf:number sfa:number="1" sfa:type="i"/>
    </sf:verticalAlignment>
    </pre>
    However, searching Apple's developer connection gives no confirmation.

Maybe you are looking for

  • Why does iCal keep telling me calendar can't be found?

    Why does iCal keep telling me calendar can't be found? I have my ical calendar synced with my android 2.3.6. They appear to be communicating and then the next time I check they aren't. I just randomly keep getting the error. I would like to sync my G

  • Web Banner Question

    I'm trying to figure out how I can make my flash banner loop without having it start from the begining everytime a user clicks on another page. How can i make the banner continue to play from where it left off once the user goes to the next page?? Th

  • Captions embedded in PSE 8 organiser photos

    Captions embedded in PSE 8 organsier photos using the 'write key word and tag and properties into photo' are not visible in Windows Photo Viewer. How do I have Captions visible regardless of which Photo app I am viewing my Albums in? Shoopa

  • Subreport

    I'm using Crystal XI with C# and need help in opening subreport. my code is as follows: pls help. strSqlM="Select * from VRP Where Cocode=1" strSqlSub="Select * from VRW Where Cocode=1" dstM = clsDAL.exAdapter(strSqlM); dstSub = clsDAL.exAdapter(strS

  • How Can I Share a Screen Remotely?

    I know how to do it on a local network. I have a AirPort Extreme and am wanting to set it up where If I am away from home on my MacBook I can access the house and help the family with problems they often run into. I figured out how to forward my port