Adjust calendar wizard vba code to get table grid lines to be set (not to show gridlines, but actually add borders like before).

Í still use the calendar wizard a lot.  But unlike earlier versions of Word, Word 2010 doesn't add the gridlines to the table which makes for an odd calendar where the boxes aren't defined; they're just a lot of numbers sitting in a big square for the entire month.

Up until now, I''ve manually gone in an had to add them but surely there's a way to tweak the vb code within the calendar wizard to fix this?  I stumbled upon how to fix the start day to be Monday.  That was a real revelation.  Can't believe that all these years I manually edited the created calendars by moving the Sunday to the end of each sheet <lol>.  So easy to fix:  http://forums.techarena.in/windows-software/1155408.htm - It was supremely easy and just required I change the line

Public Const iWeekStartDay As Integer = 0

to

Public Const iWeekStartDay As Integer = 1

because "1" represents Monday.

Very neat.

So now, if I can just get the table to have interior cell borders, that would make this completely automated again with the spiffy new end result of my never having to ever again change the start day to Monday manually ever, ever again!  <lol>

Anyone know how to do that, though?  Word 00 and 03 created the calendar with interior cell borders, I never get that in Word 10.

Thank you!!

Answer
Answer

I've tried running the calendar wizard in Word 2003, 2007, 2013, and 2010, and the tables don't have any inside borders in any of them. The difference may be due to some setting, but choosing (or rather, confirming the selection of) the Table Grid style as the default table style doesn't change it.

However, it is possible to edit the macro code in the Calendar Wizard.wiz template to add the borders.

  • Open the .wiz file itself or any document based on it, and start the macro editor.
  • In the Project pane, expand TemplateProject (Calendar wizard) > Modules > Calendar and double-click the Calendar icon to open that module in the code window.
  • Use the Find command to search for the expression Selection.Tables(1). It should find the line Selection.Tables(1).Rows(1).Height = rgsMonthNamesHeight(iCalendarStyle, iOrientation, iNoPicture)
  • In the blank line below that code, insert this:
        With Selection.Tables(1).Borders
            .InsideLineStyle = wdLineStyleSingle
            .InsideLineWidth = wdLineWidth100pt
            .InsideColorIndex = wdAuto
        End With
  • Click the Save icon on the macro editor's toolbar, which will save the .wiz template.

New calendars created after this bit of surgery will have inside borders.

_____________________________
https://jay-freedman.info

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 685 Applies to: