A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Create a macro to insert a customized table



 
 
Thread Tools Display Modes
  #1  
Old April 21st, 2006, 05:59 PM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default 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  
Old April 21st, 2006, 06:23 PM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 11:33 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.