![]() |
#1
|
|||
|
|||
![]()
To Whom It Concerns:
Thank you in advance for your time. Previous assistance on this forum has made my paperwork much, much easier. I'm hoping I can simplify the process even more by adding a macro in my attendance report template. Basically, I want a date to be generated whenever the template is opened that is the Saturday of that week. My organization operates on a Sunday through Saturday schedule. Once the Saturday date in question (reflecting the reporting period) is entered into the form field, I already have the other dates generated automatically on the template. The question is: can I create a macro that will automatically generate the Saturday for that week? It has to be the SUBSEQUENT Saturday, not the preceding Saturday. e.g. if I opened the document anytime this week (reporting period 11/03/13-11/09/13), including Saturday 11/09/13, I would want it to generate the date 11/09/13 in a form field. IF this is possible, I have one follow-up question: When saving the template, it generates a .docx. I want it to keep doing this. If a macro is present in the template, will it prompt me to save a .docm? If YES, is there a way to disable it and just have it save without the macro? I don't want the macro to persist in the documents it creates. This would sound alarm bells by those receiving the attendance reports. Thanks in advance! Sincerely, CrabApple |
#2
|
||||
|
||||
![]()
Hi CrabApple,
First off, .docx files cannot contain macros. You could, however, have a macro in the document's template. Be aware, though, that your use of the 'template' term doesn't appear to be the same as what Word regards as a template (i.e. a .dotx or .dotm file). Saving a template doesn't produce a .docx file - it remains a .dotx or .dotm file. A document created from a .dotx or .dotm template, however, will ordinarily be a .docx file. As for the dates, what you've described so far can be done without macros or formfields. To see how to do this and just about everything else you might want to do with dates in Word, check out my Microsoft Word Date Calculation Tutorial, at: http://windowssecrets.com/forums/sho...ation-Tutorial or http://www.gmayor.com/downloads.htm#Third_party In particular, look at the item titled 'Calculate a Stepped Date'. Do read the document's introductory material.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
av8r | Excel | 7 | 02-17-2016 08:04 PM |
Using Word/OL 2010 to generate personalized email messages | rickr44318 | Word | 0 | 06-26-2013 06:34 AM |
Which ODF/ .odt version is word 2010, 2013 preview & eventually 2013 full using? | semiotically | Word | 8 | 11-08-2012 05:44 PM |
Randomly generate numbers, Macro? | Jamtart | PowerPoint | 30 | 08-15-2012 10:55 AM |
![]() |
sanlen | Project | 1 | 06-25-2012 04:17 PM |