Link to home
Start Free TrialLog in
Avatar of kolson14
kolson14

asked on

Gridlines on WORD template

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.
Avatar of cquinn
cquinn
Flag of United Kingdom of Great Britain and Northern Ireland image

You can add an AutoOpen macro to the template with the following line of code


WordBasic.ShowTableGridlines

Open in new window

Avatar of kolson14
kolson14

ASKER

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?
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

ASKER CERTIFIED SOLUTION
Avatar of cquinn
cquinn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry - VBA illiterate
So the AutoNew is the same code, just replace the AutoOpen with AutoNew?
Yes - AutoNew runs when a documnt is first created, AutoOpen when a document is opened