+ Reply to Thread
Results 1 to 14 of 14

Autoupdate Date Field and Open a Particular Page in MS Word 2007

  1. #1
    Forum Contributor
    Join Date
    05-23-2017
    Location
    Bang, India
    MS-Off Ver
    MS Office 2007
    Posts
    148

    Autoupdate Date Field and Open a Particular Page in MS Word 2007

    Hi everybody!!!....we use MS Word 2007 and I have a document that I need to open everyday and save some data in that. My requirements now are below:
    1. I want the document to open always to a particular page. In my case Page Number 7.
    2. I tried to used Insert Date and Time in this word document but whenever I save the document it does not update automatically, rather I need to do it on my own by updating it every time before I save it. Is there a way to do this using vba macro for both of the above 2 problems. Thanking you all in anticipation of a solution.

  2. #2
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily NL, sometimes UK
    MS-Off Ver
    2010
    Posts
    1,526

    Re: Autoupdate Date Field and Open a Particular Page in MS Word 2007

    1. You could use this code (in the 'This Document' part of the VB Editor):
    Please Login or Register  to view this content.
    2. When you 'Insert Date and Time' make sure you select the 'Update Automatically' box at the bottom-right. Date fields should automatically update on opening. It is possible to get it to update before saving, but the VBA is more complicated, from what I read.

    Hope that helps.
    Regards,
    Aardigspook

    My internet connection can be intermittent, so sometimes I may not reply quickly to questions. Sorry - it's not personal and I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  3. #3
    Forum Contributor
    Join Date
    05-23-2017
    Location
    Bang, India
    MS-Off Ver
    MS Office 2007
    Posts
    148

    Re: Autoupdate Date Field and Open a Particular Page in MS Word 2007

    Bulls eye !!! thank you aardigspook ....the word page opening does exactly open at page 7, one more request......in page 7 ....I have a text "SAMPLES START BELOW"
    I want the cursor placed after this text.....is it possible???

    As for the date field update i have tried autoupdate but it does not update at all automatically....and i do it manually always.....so thats y i requested a VBA code for this.... Thanks for taking your time to answer me.....

  4. #4
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily NL, sometimes UK
    MS-Off Ver
    2010
    Posts
    1,526

    Re: Autoupdate Date Field and Open a Particular Page in MS Word 2007

    Try putting a bookmark after the text, then go to it instead of the page:
    Please Login or Register  to view this content.
    Let me have a bit of a play with the date/time field updating on save. I'm not a VBA expert so there will be a lot of trial and error, so it may take me some time, sorry.

  5. #5
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    2,127

    Re: Autoupdate Date Field and Open a Particular Page in MS Word 2007

    Word DATE fields auto-update upon opening a document or upon other user actions that cause it to update (e.g. printing, print-preview), not on saving or closing a document.
    Cheers,
    Paul Edstein
    [MS MVP - Word]

  6. #6
    Forum Contributor
    Join Date
    05-23-2017
    Location
    Bang, India
    MS-Off Ver
    MS Office 2007
    Posts
    148

    Re: Autoupdate Date Field and Open a Particular Page in MS Word 2007

    hi..aardigspook .....i tried what you told but it is throwing up an error bookmark not found.....
    actually SAMPLES START BELOW is in text format..... and i want the cursor to be placed below this text........thanks again......

  7. #7
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    2,127

    Re: Autoupdate Date Field and Open a Particular Page in MS Word 2007

    Try:
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    05-23-2017
    Location
    Bang, India
    MS-Off Ver
    MS Office 2007
    Posts
    148

    Re: Autoupdate Date Field and Open a Particular Page in MS Word 2007

    wow....macropod...thanks a tonne it works exactly like we wanted..............you cracked this.........
    I hope you can get a solution to auto update saved date and time fields ....with a VBA approach too.....thanks hoping something to come up from you or aardigspook or other members....thanks for all the time that you have taken to bring this up....God bless you all....

  9. #9
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    2,127

    Re: Autoupdate Date Field and Open a Particular Page in MS Word 2007

    Quote Originally Posted by Quivolt View Post
    I hope you can get a solution to auto update saved date and time fields
    As I already said:
    Quote Originally Posted by macropod View Post
    Word DATE fields auto-update upon opening a document or upon other user actions that cause it to update (e.g. printing, print-preview), not on saving or closing a document.
    Now you mention "saved date and time fields". That uses a SAVEDATE field, not a DATE field. It's behaviour is essentially the same, though. Still, it's not clear what you expect to happen. If you:
    • update the field before saving a document, it has nothing to report;
    • save a document, then update the field, doing so renders the document's saved state 'dirty' and you'd have to re-save it to retain that date/time - which is no longer the last saved date/time, since you've now saved it again - creating a never-ending loop.

  10. #10
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily NL, sometimes UK
    MS-Off Ver
    2010
    Posts
    1,526

    Re: Autoupdate Date Field and Open a Particular Page in MS Word 2007

    I think the OP wants a date/time field which works like a last-saved field, but updating with the date and time as of when save is pressed. In other words: user presses save (button or Ctrl-S), file updates field with current date & time, then saves. That would mean intercepting the save with a 'BeforeSave' type macro, which is way beyond my skills...

  11. #11
    Forum Contributor
    Join Date
    05-23-2017
    Location
    Bang, India
    MS-Off Ver
    MS Office 2007
    Posts
    148

    Re: Autoupdate Date Field and Open a Particular Page in MS Word 2007

    ohh.....well..thank you both macropod and aardigspook to shed some light on this date field..........thanks for the clear explanation by both of you on this.....) ......I think I will close this as solved for now.... maybe in case you guys come up with some solution in the future....let me be informed....thanks for all your hard work and time spent to help me out........this forum really have great EXPERTS LIKE YOU......IN HELPING OTHERS......GOOD JOB !! KEEP IT UP......ALL OF YOU.....THANKS AGAIN......

  12. #12
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    2,127

    Re: Autoupdate Date Field and Open a Particular Page in MS Word 2007

    Quote Originally Posted by Aardigspook View Post
    I think the OP wants a date/time field which works like a last-saved field, but updating with the date and time as of when save is pressed
    A DocumentBeforeSave macro could be as simple as:
    Please Login or Register  to view this content.
    Its implementation is rather more complicated than simply adding that to the document, though. See:
    http://wordmvp.com/FAQs/MacrosVBA/AppClassEvents.htm
    http://wordmvp.com/FAQs/MacrosVBA/In...tSavePrint.htm

  13. #13
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily NL, sometimes UK
    MS-Off Ver
    2010
    Posts
    1,526

    Re: Autoupdate Date Field and Open a Particular Page in MS Word 2007

    Quote Originally Posted by macropod View Post
    Its implementation is rather more complicated than simply adding that to the document, though.
    Yeah, that's why it's beyond my skills...

    @Quivolt: Thanks for the rep, glad we could help with one of your questions, sorry we couldn't fix the other one for you too.

  14. #14
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    2,127

    Re: Autoupdate Date Field and Open a Particular Page in MS Word 2007

    It's not particularly difficult - just not as obvious or straightforward as an 'ordinary' macro.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1