rgmatthes
12-31-2009, 01:41 PM
Hello -
This subroutine tries to retrieve the author name from the built-in document properties of an unopened document ("test.doc") and display it in a messagebox, but it doesn't work unless the document is currently open. Do you see how I can fix this for upopened documents?
Sub MsgBoxAuthorName()
Dim AuthorName As String
AuthorName = Documents("C:\test.doc").BuiltInDocumentProperties(wdPropertyAuthor)
MsgBox AuthorName
End Sub
Is there a simple solution for reading the built-in properties of unopened documents?
Or relatedly, if the document HAS to be open for this to work (discouraged), is there a way I can automatically close it without saving, no matter what?
THANKS!!!!
This subroutine tries to retrieve the author name from the built-in document properties of an unopened document ("test.doc") and display it in a messagebox, but it doesn't work unless the document is currently open. Do you see how I can fix this for upopened documents?
Sub MsgBoxAuthorName()
Dim AuthorName As String
AuthorName = Documents("C:\test.doc").BuiltInDocumentProperties(wdPropertyAuthor)
MsgBox AuthorName
End Sub
Is there a simple solution for reading the built-in properties of unopened documents?
Or relatedly, if the document HAS to be open for this to work (discouraged), is there a way I can automatically close it without saving, no matter what?
THANKS!!!!