Beispiel #1
0
 private static void ApplyContentsStyle(WordNet.Cell cell, WordNet.WdCellVerticalAlignment verticalAlignment = WordNet.WdCellVerticalAlignment.wdCellAlignVerticalCenter)
 {
     cell.VerticalAlignment = verticalAlignment;
     cell.Range.Font.Name   = "Arial";
     cell.Range.Font.Size   = 8;
     cell.Range.Font.Bold   = 0;
 }
Beispiel #2
0
        public void SetTableAlignment(MSWord.WdParagraphAlignment hAlign, MSWord.WdCellVerticalAlignment vAlign, int indTable = -1)
        {
            GetTableReference(indTable);

            m_pTable.Select();
            MSWord.Selection sel = m_pApp.Selection;
            sel.Cells.VerticalAlignment   = vAlign;
            sel.ParagraphFormat.Alignment = hAlign;
        }
Beispiel #3
0
        public void SetCellsMerge(int FirstColumn, int LastColumn, int FirstRow, int LastRow, MSWord.WdCellVerticalAlignment vAlignment, int indTable = -1)
        {
            if (FirstColumn == LastColumn && FirstRow == LastRow)
            {
                return;
            }

            GetTableReference(indTable);

            MSWord.Cell pCellBegin = m_pTable.Cell(FirstRow, FirstColumn);
            MSWord.Cell pCellEnd   = m_pTable.Cell(LastRow, LastColumn);
            if (pCellBegin == null)
            {
                return;
            }
            if (pCellEnd == null)
            {
                return;
            }

            pCellBegin.Merge(pCellEnd);
            pCellBegin.VerticalAlignment = vAlignment;
        }
Beispiel #4
0
        public void SetCellsAlignment(int iCol1, int iCol2, int iRow1, int iRow2, MSWord.WdParagraphAlignment hAlign, MSWord.WdCellVerticalAlignment vAlign, int indTable = -1)
        {
            GetTableReference(indTable);

            MSWord.Cell pCell1 = m_pTable.Cell(iRow1, iCol1);
            if (pCell1 == null)
            {
                return;
            }
            MSWord.Cell pCell2 = m_pTable.Cell(iRow2, iCol2);
            if (pCell2 == null)
            {
                return;
            }

            MSWord.Range r = m_pDoc.Range(pCell1.Range.Start, pCell2.Range.End);
            r.Select();
            MSWord.Selection sel = m_pApp.Selection;
            sel.ParagraphFormat.Alignment = hAlign;
            sel.Cells.VerticalAlignment   = vAlign;
        }
 public void setTableAlignment(string tableName, Word.WdCellVerticalAlignment alignment)
 {
     //_currentRange.HorizontalInVertical = Word.WdHorizontalInVerticalType.
 }