Questions tagged [word-table]

Questions about creating and modifying tables (rows and columns) programmatically (COM object model, openxml, office-js) in a Microsoft Word document. Do NOT use for Tables of Content or of Figures. This tag was created due to discontinuation of the more general tag [table].

This tag was created due to discontinuation of the more general .

Word tables are important structures in a Word document. They serve to layout information on the page in a tabular format, as well as to position some types of content horizontally on the page.

Question topics about Word tables include:

  • How to create a table and define its layout and position properties
  • How to add and delete rows and columns
  • Formatting the table, rows and columns
  • How to add, modify and format table content
  • How to read and extract table content
  • How to use Word's Find functionality in connection with a table

Useful links:

49 questions
2
votes
0 answers

is it possible to set column width and Background color for table headers

I am trying to create a table in word document using Office Js. I need to set the width for the two columns at 20% resp. 80%. The table header should be formatted with a background color. I tried using this code var Table = body.insertTable(2,…
Common_Coder
  • 131
  • 6
2
votes
1 answer

Pointing a range at the end of a table cell

In a Perl CGI, using Win32::OLE, I need to insert several text lines in a table cell, but one by one. The different objects I use are : $go_document, the Word document $lo_table, the Word table $li_row and $li_col, the cell coordinates in the…
JNM
  • 125
  • 9
1
vote
1 answer

Accessing the Value from a dropdownlist that is in a cell in a Word Table

I have a Word document that is used to provide survey responses by users. They then send the word document back to me. The documents contains a number of 2 column tables. In each row, column 1 contains text (the question) and column 2 contains one…
PLL
  • 47
  • 6
1
vote
0 answers

How can i split docx' table cell in two cells with python-docx?

I searched in python-docx User Guide and find only method merge, but not split. Also I tried to do something with document.xml but failed.
Gipakrot
  • 11
  • 2
1
vote
1 answer

Copy Word table to Excel and format as table

I have a macro in Word VBA that copies a table from a Word file and pastes it to Excel. It pastes it like this: My question now, is it possible to format that table as an “Excel table”, like when you insert a table in excel, using the vba in…
Raúl
  • 159
  • 1
  • 10
1
vote
1 answer

Choose a table to copy from a Word file into an Excel file

I have a word file with 7 tables and I want to copy one of them into an excel file. But I’d like to choose each time I run the macro which table I want to copy as I’ll have different word files with different number of tables and a different table…
Raúl
  • 159
  • 1
  • 10
1
vote
0 answers

VBA convert embedded excel sheet to word table in word file

I need to convert the embedded excel sheet object to word table in word file, I am currently using is to open the embedded excel sheet object , select the content and paste to word. Could there be a better way to simplify this action? I try to…
Chau Chun
  • 95
  • 1
  • 6
1
vote
1 answer

Combine or merge word table with condition

The word document containing multiple tables. If any table having rows equal to value x (eg. 12) then delete first row and cut that table and paste it below the last row of previous table (means join the selected table with previous table at the…
sanjay
  • 31
  • 8
1
vote
1 answer

Excel VBA to import word data to excel

I am new to VBA I want to copy word tables to excel but I am not getting the REQ- part in excel, just getting other tabs Input: Desired output: Output I get Code: Option Explicit Sub ImportWordTable() Dim wdDoc As Object Dim wdFileName As…
user8588680
1
vote
1 answer

Getting an error trying to insert field in a Word table cell

I create a formfield (textinput), and when I go to name it I get: 91 Object variable or With block variable not set There are dozens of other places in this macro where I do the same exact thing and it works fine. Here is the code: Private Sub…
Ahotch
  • 57
  • 9
0
votes
3 answers

Placing/changing cursor position to a new line after the table

The following code picks and places Excel data to the table in a Word file. Sub test_table() Dim objWord Dim objDoc Dim objSelection Dim i As Integer Dim j As Integer Set objWord = CreateObject("Word.Application") …
JOSHY T R
  • 3
  • 1
  • 1
  • 2
0
votes
1 answer

Finding content controls within Word table cells

I am basically looping through all the cells within all the tables of a given Word document. I want to be able to identify cells that contain ContentControlls. Is this possible? At least in terms of text length, cells with only ContentControls…
0
votes
1 answer

VBA excel how to get table number in for each word table

i have Word template with 3 table with empty cells. After code have finished i check if there is empty cell in each table and if table contains empty cells then code delete that table, but if table have data then i need to insert text above that…
0
votes
1 answer

How to use if-statements in WORD tables if treating characters (and not numbers)

I'm about to create a simple formular in WORD which is mainly based on a WORD table (not Excel table) in which I'd like to use if-statements. As long as I deal with numbers everything works fine. But, as soon as I use characters I get the following…
jaysigg
  • 201
  • 1
  • 7
0
votes
0 answers

Is There a More Efficient Way of Determining Whether a Table Row Spills Over Into the Footer Than Looping Through All Cells?

I'm currently using Microsoft Word 2016 VBA to programmatically set the AllowBreakAcrossPages setting so that if a row's contents overlaps the footer contents, I toggle the setting so that the row can break across pages. To solve this issue, I'm…
1
2 3 4