Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Using "wdPropertyTimeLastSaved" fon Userforms for Word.

Using "wdPropertyTimeLastSaved" fon Userforms for Word.

Scheduled Pinned Locked Moved Visual Basic
questiondesignhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Harold_Wishes
    wrote on last edited by
    #1

    Hello, This is perhaps not the best forum to post this but I've already posted to Microsoft's programming forum but have not recieved a reply. I have a question about the "wdPropertyTimeLastSaved" property in VBA for word. I have attached a userform with the following code in the initializing section of my project. The form is associated with a template that displays the form when the template is used. Essentially it displays text right on the form itself, containing the date that the template was last saved. It works great. However, there is a wrinkle in my design. Whenever, I make changes to either the template or the form, I am prompted each time I use my template, to save the template even though I did a save. I found a way around this problem, but I don't care for the solution. I must go into the VBA editor and run the form at least once and then save the associated template. That does the trick. No more prompts to save the template. However, I do not want casual users to have to go thru this extra work each time a change is made to the template and/or form. If you place this small snippet of code below in your own forms, you will know what I'm talking about. Any suggestions? Thanks. :) lblUFdate.Caption is an actual caption on my form which displays the date.

    Private Sub UserForm_Initialize()

    Dim SavedTime As Date

    SavedTime = ThisDocument.BuiltInDocumentProperties( _

    wdPropertyTimeLastSaved).Value

    lblUFdate.Caption = "Last Updated " & Format(SavedTime, "dd-mmm-yyyy
    HH:mm AM/PM")

    End Sub

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups