?
Solved

vb script insert table row before current row

Posted on 2016-08-07
3
Medium Priority
?
56 Views
Last Modified: 2016-08-07
How do I insert a row before the third row of a multi row Microsoft Word Table using VB Script  (not VBA)        

Here is my code and errl
dim tbl
set tbl = wd.ActiveDocument.Tables(1)                        
set newrow = tbl.rows.add(3)

Error:  http://www.screencast.com/t/mV9EUiu03
0
Comment
Question by:maxdbase
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 56

Expert Comment

by:Bill Prew
ID: 41746247
Which of these lines is line 86?

~bp
0
 
LVL 56

Accepted Solution

by:
Bill Prew earned 2000 total points
ID: 41746264
Try this, the documentation indicates the BeforeRow parm needs to be passed as a Row datatype, not a number.

set newrow = tbl.rows.add(tbl.Rows(3))

Open in new window

~bp
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 41746364
Note that for most things, once the environment is established (Word Application object and/or Word Documentation object etc.,  VBScript and VBA are the same.

(Follow Bill Prew for the actual solution)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question