If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Create a macro to insert a customized table
Hello:
I'm trying to create a macro to insert a customized table in a document. I know next to nothing about VB, but do have some programming background. I want to create this table so that others in my group can quickly insert it to have the same style formats and shading applied to tables throughout the document. I've read some VB articles, and found the following code to insert a table. Unfortunatley, it's using an AutoFormat table and I'm clueless about how to customize the code to suit my needs. Sub Test() Selection.Collapse Direction:=wdCollaspeStart Set myTable = ActiveDocument.Tables.Add(Range:=Selection.Range, NumRows:=5, NumColumns:=5) myTable.AutoFormat Format:=wdTableFormatClassic2 End Sub I would appreciate any help, link, reference, etc. Thanks |
#2
|
|||
|
|||
Create a macro to insert a customized table
Unless you are changing your customizations dynamically, why not just create
the table and save it as an AutoText entry. If need be, you can use a macro to retrieve the AutoText. -- Charles Kenyon Word New User FAQ & Web Directory: http://addbalance.com/word Intermediate User's Guide to Microsoft Word (supplemented version of Microsoft's Legal Users' Guide) http://addbalance.com/usersguide See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome! My criminal defense site: http://addbalance.com --------- --------- --------- --------- --------- --------- This message is posted to a newsgroup. Please post replies and questions to the newsgroup so that others can learn from my ignorance and your wisdom. "Zippy07" wrote in message ... Hello: I'm trying to create a macro to insert a customized table in a document. I know next to nothing about VB, but do have some programming background. I want to create this table so that others in my group can quickly insert it to have the same style formats and shading applied to tables throughout the document. I've read some VB articles, and found the following code to insert a table. Unfortunatley, it's using an AutoFormat table and I'm clueless about how to customize the code to suit my needs. Sub Test() Selection.Collapse Direction:=wdCollaspeStart Set myTable = ActiveDocument.Tables.Add(Range:=Selection.Range, NumRows:=5, NumColumns:=5) myTable.AutoFormat Format:=wdTableFormatClassic2 End Sub I would appreciate any help, link, reference, etc. Thanks |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
trying to create an insert row macro | sam_c | General Discussion | 4 | March 20th, 2007 02:45 PM |
Add New Field to DB | Karen | Database Design | 7 | October 19th, 2005 08:03 PM |
Multiple Records By Date | Vel. | Running & Setting Up Queries | 3 | August 22nd, 2005 09:23 AM |
Multiple Options Group | Patty Stoddard | Using Forms | 19 | August 4th, 2005 02:30 PM |
Table Design | A. Williams | Database Design | 3 | April 29th, 2005 07:02 PM |