View Single Post
 
Old 04-26-2011, 02:52 AM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Karl,

Oops! Here's the corrected (and complete) code:
Code:
Private Sub Document_Close()
Dim StrOldTitle As String, StrNewTitle As String
Dim StrOldAuthor As String, StrNewAuthor As String
Dim StrOldSubject As String, StrNewSubject As String
Dim StrOldStatus As String, StrNewStatus As String
Dim bSaved As Boolean
With ActiveDocument
  bSaved = .Saved
  StrOldTitle = .BuiltInDocumentProperties("Title").Value
  StrOldAuthor = .BuiltInDocumentProperties("Author").Value
  StrOldSubject = .BuiltInDocumentProperties("Subject").Value
  StrOldStatus = .BuiltInDocumentProperties("Content Status").Value
  StrNewTitle = InputBox("Enter the Document Title:", "Title", StrOldTitle)
  StrNewAuthor = InputBox("Enter the Document Author:", "Author", StrOldAuthor)
  StrNewSubject = InputBox("Enter the Client and Site Name:", "Subject", StrOldSubject)
  StrNewStatus = InputBox("Enter the Document Status:", "Status", StrOldStatus)
  If StrOldTitle <> StrNewTitle Then _
    .BuiltInDocumentProperties("Title").Value = StrNewTitle
  If StrOldAuthor <> StrNewAuthor Then _
    .BuiltInDocumentProperties("Author").Value = StrNewAuthor
  If StrOldSubject <> StrNewSubject Then _
    .BuiltInDocumentProperties("Subject").Value = StrNewSubject
  If StrOldStatus <> StrNewStatus Then _
    .BuiltInDocumentProperties("Content Status").Value = StrNewStatus
  If bSaved = True And .Saved = True Then Exit Sub
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote