Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-03-2017, 03:07 PM
cepdance cepdance is offline Use Macros to add a new row in protected document Mac OS X Use Macros to add a new row in protected document Office for Mac 2011
Novice
Use Macros to add a new row in protected document
 
Join Date: Jan 2017
Posts: 4
cepdance is on a distinguished road
Default Use Macros to add a new row in protected document

Let me start by saying the only things I know of macros is what I've read on the internet today so far.



I have a word document that's a fillable form, and in it I have 2 tables that I would like the option of adding additional rows if needed. I'd like the new row to have the same formatting as the row above it (text entry, combo drop down boxes, etc)

I found some macros code that sort of started to do what I wanted, but an error would pop up.

I now understand the process of adding the macro and using it in the table cell "on exit", And that it needs to be in a docm format- I just need the proper code to make it do what I want. Is there anywhere i can find that?

I've attached the document for reference.
Thank you for your help!
Attached Files
File Type: docm Production Show Report 2017 macro.docm (465.4 KB, 11 views)
Reply With Quote
  #2  
Old 01-03-2017, 10:30 PM
gmayor's Avatar
gmayor gmayor is offline Use Macros to add a new row in protected document Windows 10 Use Macros to add a new row in protected document Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Look at the example code at http://www.gmayor.com/word_vba_examples_2.htm - especially 'An alternative method of adding a row to a protected table'
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 01-03-2017, 10:48 PM
macropod's Avatar
macropod macropod is offline Use Macros to add a new row in protected document Windows 7 64bit Use Macros to add a new row in protected document 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

Since you're using formfields, see the demonstration document in this post: https://www.msofficeforums.com/word-...html#post38312
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 01-04-2017, 07:38 AM
cepdance cepdance is offline Use Macros to add a new row in protected document Mac OS X Use Macros to add a new row in protected document Office for Mac 2011
Novice
Use Macros to add a new row in protected document
 
Join Date: Jan 2017
Posts: 4
cepdance is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Since you're using formfields, see the demonstration document in this post: https://www.msofficeforums.com/word-...html#post38312
Thank you! When I use this code, I get this error:

Microsoft Visual Basic
Run Time Error 4605
This method or property is not available because no text is selected

Have I done something wrong?
Reply With Quote
  #5  
Old 01-04-2017, 07:41 AM
cepdance cepdance is offline Use Macros to add a new row in protected document Mac OS X Use Macros to add a new row in protected document Office for Mac 2011
Novice
Use Macros to add a new row in protected document
 
Join Date: Jan 2017
Posts: 4
cepdance is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
Look at the example code at http://www.gmayor.com/word_vba_examples_2.htm - especially 'An alternative method of adding a row to a protected table'
Thank you! I tried using this code yesterday and I end up with the error

Microsoft Visual Basic
Run Time Error 438
Object doesn't support this property or method

Is there a step I haven't taken?

Thanks!
Reply With Quote
  #6  
Old 01-04-2017, 08:16 AM
gmayor's Avatar
gmayor gmayor is offline Use Macros to add a new row in protected document Windows 10 Use Macros to add a new row in protected document Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

It seems you are using the Mac version of Word, which I hadn't noticed . The code is unlikely to work on the Mac version. It also won't work in tables that have split/merged cells, like those in your first table, but the PC version should work in your other tables.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #7  
Old 01-04-2017, 08:18 AM
cepdance cepdance is offline Use Macros to add a new row in protected document Mac OS X Use Macros to add a new row in protected document Office for Mac 2011
Novice
Use Macros to add a new row in protected document
 
Join Date: Jan 2017
Posts: 4
cepdance is on a distinguished road
Default

I was able to make it work! I just had to rename the cells
Thank you for your help!!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Password Protected Template with Macros eking Word 3 12-20-2016 01:05 PM
Macros don't work in password protected file. Auto Excel Programming 2 06-29-2016 12:17 AM
Use Macros to add a new row in protected document Enable watermark in a protected document erickalves05 Word 2 10-17-2014 10:26 AM
Use Macros to add a new row in protected document embedded links in protected document John147 Word 1 08-10-2014 04:18 AM
Using bookmarks in a protected document Bill Stemp Word 0 10-16-2010 06:47 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:21 AM.


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