Looking for a way to turn off gridlines.

T

Tonya Marshall

I need a way to automatically turn off table gridlines on opening
a document from a template. Everything I've tried needs to be
debugged. Thank you.
 
J

Jean-Guy Marcil

Tonya Marshall was telling us:
Tonya Marshall nous racontait que :
I need a way to automatically turn off table gridlines on opening
a document from a template. Everything I've tried needs to be
debugged. Thank you.


Why?

The following Sub in the ThisDocument module will work:
'_______________________________________
Private Sub Document_Open()

With ActiveWindow.View
.TableGridlines = False
.ShowTextBoundaries = False
End With

End Sub
'_______________________________________

You have to turn off text boundaries as well.

Also, I would recommend that you stored the user's settings before changing
them and reset them when you close the document...
I would be annoyed if my settings where changed every time I opened a
particular document...

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
T

Tonya Marshall

Jean-Guy Marcil said:
Tonya Marshall was telling us:
Tonya Marshall nous racontait que :



Why?

The following Sub in the ThisDocument module will work:
'_______________________________________
Private Sub Document_Open()

With ActiveWindow.View
.TableGridlines = False
.ShowTextBoundaries = False
End With

End Sub
'_______________________________________

You have to turn off text boundaries as well.

Also, I would recommend that you stored the user's settings before
changing them and reset them when you close the document...
I would be annoyed if my settings where changed every time I opened a
particular document...

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
I agree, I would be annoyed, too. This is not for me. It was requested by a
departmental head because she didn't like the gridlines showing in a form I
had made that was to be filled in by several people. It's a locked form with
text form fields in it. Apparently her gridlines were on when she opened a
document from the template and I told her how to hide the gridlines and she
asked it they could be turned off for that form. I told her that when they
were off they were off for all documents and couldn't be selective as to
which documents they showed in and that I didn't think it would be possible
to have them off each time a document was created from the template unless
they were already off.

I think I will continue to let her think that way as I'm sure the other
users would find it annoying. What I can do is make a small toolbar for the
template with the gridlines button it and each user can control it as they
wish. I could put some text with the icon saying it's for turning off the
lines.

Thank you, Jean-Guy. I appreciate your input about it as well as the time
you spent making the macro.

Tonya Marshall
 
J

Jean-Guy Marcil

Tonya Marshall was telling us:
Tonya Marshall nous racontait que :

I agree, I would be annoyed, too. This is not for me. It was
requested by a departmental head because she didn't like the
gridlines showing in a form I had made that was to be filled in by
several people. It's a locked form with text form fields in it.
Apparently her gridlines were on when she opened a document from the
template and I told her how to hide the gridlines and she asked it
they could be turned off for that form. I told her that when they
were off they were off for all documents and couldn't be selective as
to which documents they showed in and that I didn't think it would be
possible to have them off each time a document was created from the
template unless they were already off.

You could have a class event that checked for current document' attached
template and reset the gridlines as needed. But if this is only to placate
one user, it is not worth it!
I think I will continue to let her think that way as I'm sure the
other users would find it annoying. What I can do is make a small
toolbar for the template with the gridlines button it and each user
can control it as they wish. I could put some text with the icon
saying it's for turning off the lines.

That is defintely the easiest way of handling it.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

Jay Freedman

Tonya said:
Jean-Guy Marcil said:
Tonya Marshall was telling us:
Tonya Marshall nous racontait que :



Why?

The following Sub in the ThisDocument module will work:
[...]
I agree, I would be annoyed, too. This is not for me. It was
requested by a departmental head because she didn't like the
gridlines showing in a form I had made that was to be filled in by
several people. It's a locked form with text form fields in it.
Apparently her gridlines were on when she opened a document from the
template and I told her how to hide the gridlines and she asked it
they could be turned off for that form. I told her that when they
were off they were off for all documents and couldn't be selective as
to which documents they showed in and that I didn't think it would be
possible to have them off each time a document was created from the
template unless they were already off.

I think I will continue to let her think that way as I'm sure the
other users would find it annoying. What I can do is make a small
toolbar for the template with the gridlines button it and each user
can control it as they wish. I could put some text with the icon
saying it's for turning off the lines.

Thank you, Jean-Guy. I appreciate your input about it as well as the
time you spent making the macro.

Tonya Marshall

There's a non-macro solution (one that Suzanne Barnhill kept reminding me
about, until I finally remember it!):

Use the Format > Borders and Shading dialog. Turn on all the borders of the
table and color them white. That will hide the gridlines if they're turned
on, and it will be invisible unless the user has changed the background
color of all windows in the Control Panel > Display dialog.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top