Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.tables
|
|||
|
|||
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
Posted to microsoft.public.word.tables
|
|||
|
|||
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 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Table Format Style vs. Table Text Style | Page Layout | |||
Macro to insert AutoText table loses text formatting | Tables | |||
Help with macro to add ":" after Table # | Microsoft Word Help | |||
Trying to create word macro to insert into SQL Server | New Users | |||
Word 2003 Table AutoFormat vs Macro vs VBA | Tables |