Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-26-2011, 02:52 AM
macropod's Avatar
macropod macropod is online now Help with Document Properties Prompt Macro Windows 7 32bit Help with Document Properties Prompt Macro Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,536
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
  #2  
Old 04-26-2011, 02:57 AM
KJJ KJJ is offline Help with Document Properties Prompt Macro Windows Vista Help with Document Properties Prompt Macro Office 2007
Novice
Help with Document Properties Prompt Macro
 
Join Date: Apr 2011
Posts: 6
KJJ is on a distinguished road
Default

Almost there! ...

Quote:
Originally Posted by macropod View Post
StrNewStatus = InputBox("Enter the Document Status:", "Status", StrOldStatus)
Should be:
StrNewStatus = InputBox("Enter the Document Status:", "Content Status", StrOldStatus)

Many thanks

Karl
Reply With Quote
Reply



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

Other Forums: Access Forums

All times are GMT -7. The time now is 02:26 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2026 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft