![]() |
|
|
|
#1
|
|||
|
|||
|
Thanks for the quick reply. I tried that and unfortunately it doesn't seem to work. I get an error on this line: StrOldStatus = .BuiltInDocumentProperties("Status").Value It maybe suggests that 'status' is not a 'Built In Document Property' or that 'status' is not the correct description? Thnaks Karl |
|
#2
|
|||
|
|||
|
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
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Disable email security prompt | mcinnes01 | Outlook | 1 | 03-17-2011 07:00 AM |
| Selecting the macro document | lars | Word VBA | 0 | 08-19-2010 06:06 AM |
| Macro to put content into keywords properties? | erik2000 | Word VBA | 3 | 03-05-2010 10:14 PM |
| Macro to export document sections to individual txt files? | MJMR999 | Excel Programming | 0 | 02-18-2010 12:49 PM |
| document properties issues | charris1980 | Word | 0 | 04-29-2009 12:49 PM |