Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    creating formula in field for next Sunday

    I want to create a formula in a Microsoft Word 2010 field that will always show the following Sunday in MMMM, MMM DD, YYYY format. I've attached what I have tried to do. The Excel object works, but needs to be updated. How can I this so it appears automatically each time I open the file?
    Attached Files Attached Files

  2. #2
    Star Lounger
    Join Date
    Feb 2011
    Location
    Washington, DC
    Posts
    98
    Thanks
    8
    Thanked 6 Times in 6 Posts
    Here is a reference that shows how to do similar things using formula fields and VBA, with no need for Excel.

    http://www.addbalance.com/word/datefields2.htm

    Also check out Macropod's amazing date calculation material here: http://www.gmayor.com/downloads.htm#Third_party

    scroll down and look for DateCalc.zip and WordFieldMaths.zip

    - Jessica

  3. #3
    New Lounger
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question is there answer to my question?

    Hi, I'm sorry. I am trying to create a function that would display the next Sunday, not what I was referred. Does anyone know the solution? Is it possible?

    Thanks.

  4. #4
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Why look in external sites, when all you need is here: http://lounge.windowssecrets.com/ind...owtopic=249902

    The tutorial does have a field code for doing exactly what you asked for!!! See 'Calculate a Stepped Date'.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  5. #5
    New Lounger
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs down where do you enter the code?

    Paul,

    I found the file that explains in detail about the different codes. I think I know how to make it so it would display the next Sunday each time I open the file, but I still don't know how the code should read?

    I'm thinking that the code needs this:
    {SET Weekday 6}

    When I enter it in, the spaces are omitted and becomes {SETWeekday6}.

    Where do I enter code the in {DATE \@ MMMM, MMM dd, yyyy} or however it should be written?

    Just to let you know, these forums don't help people who don't know what they're doing. There are no step by step screen prints of how it should be done.

    I was hoping someone would just write the code for me to enter so I wouldn't need to figure it out myself.

    This probably explains why the website is called Windows Secrets.

  6. #6
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Quote Originally Posted by vchen001 View Post
    I found the file that explains in detail about the different codes. I think I know how to make it so it would display the next Sunday each time I open the file, but I still don't know how the code should read?
    Did you read the tutorial's Introduction?
    I'm thinking that the code needs this:
    {SET Weekday 6}

    When I enter it in, the spaces are omitted and becomes {SETWeekday6}
    No, you don't need to do anything like that. As I said in my previous post, this a field code for doing exactly what you asked for. All you need to do is to copy and paste it into your own document.
    Just to let you know, these forums don't help people who don't know what they're doing. There are no step by step screen prints of how it should be done.
    All you need to know is in the Introduction.
    I was hoping someone would just write the code for me to enter so I wouldn't need to figure it out myself.
    I've already done everything except the copy & paste for you. I think you should be able to manage that much.
    This probably explains why the website is called Windows Secrets.
    I guess things will always remain a secret to those who don't RTM.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  7. #7
    Star Lounger
    Join Date
    Feb 2011
    Location
    Washington, DC
    Posts
    98
    Thanks
    8
    Thanked 6 Times in 6 Posts
    I knew it was here somewhere, but searches didn't turn it up and all the links elsewhere are to the old wopr location. Thanks for posting the direct link.

    For others following the link, the most current version of the tutorial is attached to a post on the last page of the post replies.
    Last edited by jweissmn1; 2012-10-12 at 20:03.

Tags for this Thread

Posting Permissions

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