#1
|
|||
|
|||
Use command button to duplicate table
I am attempting to create a template that currently has a table with dependent drop downs and can be opened in outlook upon completion. I am struggling to find a way to duplicate the table (with the content controls intact) whenever a user presses a command button. I was looking into saving the table as a bookmark then inserting a blank copy of the bookmark below whenever the button is pressed, but I am open to other methods.
On a secondary note, the current code is doing well when copying the table to outlook but if more than one table is present only the first table shows up in outlook. Any help on changing the code to copy all tables present would be much appreciated! |
#2
|
||||
|
||||
I think you should use a Repeating Section Content Control for your table in the Word document which gives you the ability to add or remove copies of the table easily.
Then modify the code to create and populate the email to copy a range larger than the first table of the document. See attached modifications to your template.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Hello and thank you! The multiple tables copying over to outlook works nicely!
I tried the repeating section CC previously and it causes the userform I also created to automatically pop up whenever a new table is added. Would you know of a way to avoid this? I would only like the userform to pop up when a user actually selects the field. |
#4
|
||||
|
||||
The reason that dialog pops up is because the macro is triggered when you add a section and the cursor jumps to the FIRST CC in that new section which happens to be the CC which displays that dialog.
It would be easily resolved if you add CCs for every field (ie add a CC for Account Name and Account Number) so that the first CC is no longer the Section one.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Command Button to duplicate a row in a table | ccice1221 | Word VBA | 4 | 01-22-2024 02:33 PM |
Command button. To multi command | Taylormations | Word VBA | 11 | 09-14-2020 02:39 AM |
Command Button | herman777 | Excel Programming | 2 | 06-02-2019 06:45 AM |
Show table list by using chek box command and save document on sharepoint by using command button | Zhibek | Word VBA | 3 | 08-16-2018 06:19 PM |
Command Button | knp11 | PowerPoint | 2 | 01-18-2015 01:41 PM |