Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 11-19-2019, 02:17 PM
macropod's Avatar
macropod macropod is offline Macro to add row to table in a Word form Windows 7 64bit Macro to add row to table in a Word form Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by noemis View Post
I can't copy the macro
Simply open the document, press Alt-F11 to ope the VBA Editor and copy/paste from there.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #17  
Old 11-20-2019, 08:32 AM
noemis noemis is offline Macro to add row to table in a Word form Windows 8 Macro to add row to table in a Word form Office 2016
Novice
 
Join Date: Nov 2019
Posts: 5
noemis is on a distinguished road
Default

Thanks for your swift reply after so many years of this thread being dormant!

I'm not seeing the code "pane". I'm new to this as you can probably guess.

MACRO Example.docx
Reply With Quote
  #18  
Old 11-20-2019, 02:00 PM
macropod's Avatar
macropod macropod is offline Macro to add row to table in a Word form Windows 7 64bit Macro to add row to table in a Word form Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

That is a code pane, but you evidently didn't open it from the 'Formfields - Table Rows Add' document. No matter, simply click on the + sign next to that entry, then double-click on that project's 'ThisDocument' code module.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #19  
Old 11-21-2019, 02:04 AM
noemis noemis is offline Macro to add row to table in a Word form Windows 8 Macro to add row to table in a Word form Office 2016
Novice
 
Join Date: Nov 2019
Posts: 5
noemis is on a distinguished road
Default

Thank you Paul.
Reply With Quote
  #20  
Old 11-21-2019, 09:21 AM
noemis noemis is offline Macro to add row to table in a Word form Windows 8 Macro to add row to table in a Word form Office 2016
Novice
 
Join Date: Nov 2019
Posts: 5
noemis is on a distinguished road
Default

Sorry Paul, being very new to this and somewhat simple minded I can't get it to work despite you expansive instructions in the Macro itself. I have tried using the Record Macro feature with some success, however, it won't maintain sequential numbering and requires a button on the QAT which is sub optimal.

The document contains 3 separate tables and I wish in each case that when the row is complete a new row is automatically generated. Some departments will have a dozen or so rows to complete, others will have dozens hence not wishing to fix the number of rows.

My instinct is to restrict editing on this just allowing the user to fill in the form and not fiddle with the headings. Am I being too ambitious or is this achievable by a complete novice?
Attached Files
File Type: docm SERIAL.docm (29.8 KB, 14 views)
Reply With Quote
  #21  
Old 11-21-2019, 02:00 PM
macropod's Avatar
macropod macropod is offline Macro to add row to table in a Word form Windows 7 64bit Macro to add row to table in a Word form Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Without wanting to place too fine a point on it, the macro discussed in this thread is for use in documents containing formfields. Your document has no formfields; it has content controls.

For adding a new row to a table in a document with content controls, see:
Code to add new row in table
Macro to add row to table in a Word form
https://www.msofficeforums.com/word-...tml#post145675
The first of these has all you need.

There is certainly no need for a button on the QAT when using the correct code. The reason you needed one for the code in this thread is that you're not using formfields and, as a result, can't use their 'on exit' macro property to trigger the code; this isn't required for content controls.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #22  
Old 11-22-2019, 02:44 AM
noemis noemis is offline Macro to add row to table in a Word form Windows 8 Macro to add row to table in a Word form Office 2016
Novice
 
Join Date: Nov 2019
Posts: 5
noemis is on a distinguished road
Default

Thank you Paul, I will now work through what you have given me so as to learn for the future.

Hope you're not near the fires, stay safe.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to add row to table in a Word form Macro help sought for Word table xan Word VBA 1 04-20-2012 07:50 PM
Macro to add row to table in a Word form Create Table Form from Word Document gsj224 Word VBA 3 07-31-2011 09:26 AM
Macro to add row to table in a Word form Word Macro That Checks a Check Box Form Field When File Print is Executed DKerne Word VBA 4 06-09-2011 11:54 AM
Do I need a Form or a Macro?? Keith24249 Excel 0 08-23-2010 06:23 AM
Use Form Checkbox to Add Table laxonator Word Tables 0 10-23-2008 06:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:29 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft