View Single Post
 
Old 04-26-2011, 02:34 AM
KJJ KJJ is offline Windows Vista Office 2007
Novice
 
Join Date: Apr 2011
Posts: 6
KJJ is on a distinguished road
Default

Thanks Paul,

That sorted out the status issue nicely. I think there were a couple of issues with the last few lines of your code, so i have amended this as below. Does this look right to you? Seems to work ok.

Many thanks again.

Karl


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)
    If StrOldTitle <> StrNewTitle Then _
      .BuiltInDocumentProperties("Title").Value = StrNewTitle
    If StrOldAuthor <> StrNewAuthor Then _
      .BuiltInDocumentProperties("Author").Value = StrNewAuthor
    If StrOldStatus <> StrNewStatus Then _
      .BuiltInDocumentProperties("Content Status").Value = StrNewStatus
    If StrOldSubject <> StrNewSubject Then _
      .BuiltInDocumentProperties("Subject").Value = StrNewSubject
    If bSaved = True And .Saved = True Then Exit Sub
  End With
  End Sub
Reply With Quote