Solved

Gridlines on WORD template

Posted on 2011-03-01
6
634 Views
Last Modified: 2012-05-11
I have created various label templates in WORD for our users.  These are individual WORD templates on our network share.  Most Label templates are created in a Table, some of the labels we use had to be made from scratch - and the Tables are quite complicated.

My question is this....is there a way to do this and make it so all users can see the gridlines when they open the document - regardless of their own settings in WORD?  In otherwords, turn "view gridlines" (for tables) on as a default setting on the template itself - OR is there a setting that I'm missing in WORD that will allow the users to see the gridlines on any document that has a table?

Hope that made sense.
0
Comment
Question by:kolson14
  • 4
  • 2
6 Comments
 
LVL 15

Expert Comment

by:cquinn
ID: 35010463
You can add an AutoOpen macro to the template with the following line of code


WordBasic.ShowTableGridlines

Open in new window

0
 
LVL 1

Author Comment

by:kolson14
ID: 35010828
cquinn - got it, tried it in a new document by going into visual basic, pasting in the code you sent (it's just the one line right?) and saved it to the network share.   Went to another computer opened the document and got a macro warning.  Enabled all macros in Word and Enabled VBA, exited out and reopened, and it didn't work.....what am I missing?
0
 
LVL 15

Expert Comment

by:cquinn
ID: 35011259
Not just the one line - you need an AutoOpen macro in the template that the document is based on - whole code posted below.

I have tried it on one of my templates and it works fine


Public Sub AutoOpen()
 
WordBasic.ShowTableGridlines

End Sub

Open in new window

0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 15

Accepted Solution

by:
cquinn earned 125 total points
ID: 35011274
PS  You may also need to have the same in an AutoNew macro if you want the gridlines to appear when the document is created, not just when an existing document is opened.
0
 
LVL 1

Author Comment

by:kolson14
ID: 35011523
Sorry - VBA illiterate
So the AutoNew is the same code, just replace the AutoOpen with AutoNew?
0
 
LVL 15

Expert Comment

by:cquinn
ID: 35011915
Yes - AutoNew runs when a documnt is first created, AutoOpen when a document is opened
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Do you ever need to create a 20 page Word document for some testing purpose? Are you tired of copying & pasting old boring "lorem ipsum" text over and over again, increasing font size and line space in order to make the document 20+ pages long? Look…
This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question