Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-04-2024, 02:11 PM
bossroy bossroy is offline Use command button to duplicate table Windows 10 Use command button to duplicate table Office 2016
Novice
Use command button to duplicate table
 
Join Date: Feb 2024
Posts: 9
bossroy is on a distinguished road
Default 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!
Attached Files
File Type: docm Templatev2.docm (42.1 KB, 2 views)
Reply With Quote
  #2  
Old 03-04-2024, 05:40 PM
Guessed's Avatar
Guessed Guessed is online now Use command button to duplicate table Windows 10 Use command button to duplicate table Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,974
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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.
Attached Files
File Type: docm Templatev3.docm (43.5 KB, 2 views)
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 03-05-2024, 06:44 AM
bossroy bossroy is offline Use command button to duplicate table Windows 10 Use command button to duplicate table Office 2016
Novice
Use command button to duplicate table
 
Join Date: Feb 2024
Posts: 9
bossroy is on a distinguished road
Default

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.
Reply With Quote
  #4  
Old 03-05-2024, 05:16 PM
Guessed's Avatar
Guessed Guessed is online now Use command button to duplicate table Windows 10 Use command button to duplicate table Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,974
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
Reply



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

Other Forums: Access Forums

All times are GMT -7. The time now is 05:10 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