Page 2 of 7 FirstFirst 1234 ... LastLast
Results 16 to 30 of 92
  1. #16
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,764
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: Date Calculations in Word (1.60)

    hi macropod,

    I did notice lots of version numbers in the thread (1.00, 1.01, 1.1 and now 1.6). I did also notice the *NEW in the listing of topics. This is good stuff. I'll probably show it off at my Word Workshop later in the month. You've saved me from planning half a lesson - at least. Thanks. <img src=/S/salute.gif border=0 alt=salute width=15 height=20>

    Fred

  2. #17
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,855
    Thanks
    0
    Thanked 176 Times in 162 Posts

    Re: Date Calculations in Word (1.01)

    What, you didn't like the am/pm solution I gave in the penultimate example? OK, I didn't have a.m./p.m. (i.e. with the periods), but at least I had the lowercase representation - and the periods are there now if you want to see them.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. #18
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Los Angeles, California, USA
    Posts
    289
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Calculations in Word (1.01)

    I am truly impressed Macropod. Who says you can't teach a new dog old tricks...or, in this case, typography. Thanks again. Handy calculations to add to my toolkit!

  4. #19
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Calculations in Word (2.00)

    Hi Macropod

    This looks great, and obviously lots of work done on your part. Thank you.
    Are you looking for any further "contributions"? I have a few date-related bits & pieces I've compiled over the years. Those that come to mind include:

  5. #20
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,855
    Thanks
    0
    Thanked 176 Times in 162 Posts

    Re: Date Calculations in Word (2.00)

    Hi Alan,

    I always open to suggestions. Indeed, quite a few of the examples in the file come from solutions I
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  6. #21
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Calculations in Word (2.00)

    Macropod

    It was actually <post#=341919>post 341919</post#> that reminded me of the date ordinal issue. I guess my code for this is a bit of a combination of a and b above <img src=/S/grin.gif border=0 alt=grin width=15 height=15>. I hadn't realized that your approach was specifically geared towards avoiding VBA; but now that you point it out it's abundantly clear!

    Alan

  7. #22
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Date Calculations in Word (2.00)

    I must admit I'd be interested in your method of calculating the day of the week for historical dates - I work in the Regency period a lot (1811-1820 specifically, although often taken as French Revolution 1789 to Victoria 1837) and it would be great to have a quick way of finding out the day a date fell on!

    Ta muchly
    Beryl M


  8. #23
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Calculations in Word (2.00)

    Hi Beryl

    My method is probably not an orthodox one, because I adapted it directly from a "trick" I learned as a kid, when my powers of mental arithmetic were good enough for me to work out such answers in my head. I could dig out the code and post it if you like (it's javascript). If you want the general method, I'll have to rely on a fete of memory. The answer you get is a number in the range 0 -> 6, with 0 = Sat, 1 = Sun, ... 6 = Fri. I'll try it with today's date: 12 Feb, 2004...

    Start with the year and look at just the last 2 digits (=04) then divide by 12. Remember:
    Attached Files Attached Files

  9. #24
    New Lounger
    Join Date
    Jan 2004
    Location
    Papillion, Nebraska
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Calculations in Word (2.10)

    Wow--I really appreciate the good ideas. I'm not sure if this is the best option for us. The "printdate" is inserted for a multi-function marco. Yes, we could add the delayed date into the macro. However, the example I gave of changing the date at 1:00 just an example. This time can very depending of factors such as workload where we may need to wait until later to change the date, we may have a rush special request very late in the day where we need to use a current date, etc. I realize changing the system date does reflect in other system-generating dating purposes. That really doesn't seem to hinder us. In our instance, I believe changing the system date was a better option. I'm not sure what is restricting us from doing that in our present environment, whether it be Window XP or active directory. Maybe I should have posted this in a different classification. Any further input is welcome. As stated, I think I've received some great ideas--which may still be the way we go. I just want to visit all avenues before implementing. Thanks so much.

  10. #25
    Star Lounger
    Join Date
    May 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Calculations in Word (2.10)

    Instead of advancing the date based on 1pm, 2 pm etc, maybe you should prompt the user with a Yes/No message box or an ASK field. Use this input to advance the date as required. You could modify macropod's field <post#=342520>post 342520</post#> so that it advanced the date if the user responded 'yes' to the prompt. I feel that as changing the system date can affect many things (especially if you forget to change it back) you should try to avoid it where possible.

    Regards,

    Matthew

  11. #26
    Star Lounger
    Join Date
    Feb 2002
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Calculations in Word (2.20)

    I came here looking for a way to insert CREATEDATE (or any date) +30 days into an invoice. Which as any fule kno is a piece of cake in excelwith a date in A1 then =A1+30 then format as a date does the job. Your document does the job impeccably as far as I can see but - phew - 29 concatenated and nested fields! Is there no way word handles DATE +30 (days) more easily. ISTR doing a similar thing to get the previous month in a doc, which involved a load of IFing.
    Apart from that a magnificent piece of work.

  12. #27
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Calculations in Word (2.20)

    Hi Tim:
    I don't know about easier, since macropod has placed the fields in an add-in & you can copy & paste from it if you want. I was able to located <!post=this thread,220742>this thread<!/post> which gave a macro solution, but didn't work for that user.
    Cheers,

  13. #28
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,855
    Thanks
    0
    Thanked 176 Times in 162 Posts

    Re: Date Calculations in Word (2.20)

    Hi Tim,

    Apart from using vba, which may or may not be considered simpler, there really doesn't seeem to be an easy way to get Word to do date calculations. If Word stored dates as a number the way Excel does, it would be a trivial matter. But Word doesn't do that and even Excel chokes on dates before 1/1/1900.

    As for getting the previous month, there is an example in the document that allows you to specify a number of months as the 'delay' parameter. Use that with -ve values for previous months.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  14. #29
    Star Lounger
    Join Date
    Feb 2002
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date Calculations in Word (2.20)

    Thanks Phil and macropod: I agree that it's all made very simple by cutting and pasting the fields, but I also need to explain it!
    There are a couple of VBA things that work (assume a bookmark named duedate)
    Mydate = Date
    Due = DateAdd("d", 30, Mydate)
    ActiveDocument.Bookmarks("duedate").Select
    Selection.InsertAfter Due

    or shorter in coarse VBA
    ActiveDocument.Bookmarks("duedate").Select
    Selection.TypeText Text:=Format(Date + 30, "d mmmm yyyy")

    Tim

  15. #30
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,855
    Thanks
    0
    Thanked 176 Times in 162 Posts

    Re: Date Calculations in Word (2.20)

    Hi Tim,

    Yes, all of the calculations in the document can be done with vba but, as explained in a previous post "much of the [i]r
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Page 2 of 7 FirstFirst 1234 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •