Doc descriptions that are visible in folder's "Details" view?

F

Fern

Hi,

Sorry if I'm explaining myself wrong or if a solution is already posted
somewhere, but I dont' know exactly how to explain this so I don't know what
to search for...

Is there a way to use VBA to add a brief description about a word document
into the "Description" category (like "name", "date modified", "size", etc)
of the folder it's in?? For example, let's say that I save document
'May2.doc' to the 'My Documents' folder and then I change the folder's "View"
setting to "Details" so I can see info about all of the files in the folder.
One of the columns that you can choose to show is called "Description". Is
there a way for me to write my own description of May2.doc so it'll show up
in that column and so that I can distinguish its contents from those of May1,
May3, May4, etc without having to open each one??

Alternatively, is there a way to add a description to the little pop-up
window that appears when my mouse hovers over the name of each file?? I
wouldn't be able to sort that, the way I can with "Description", but at least
I could still find the file I wanted... eventually.

Thanks for any ideas or new directions you can offer!
 
S

Shane

Hi.

While Windows has a Description column I'm not aware of a Description
property in Word. You'd want Comments. These are available in both.

You could just use the normal document properties dialog to enter a
comment and yes you could create a custom dialog to achieve the same
result. It all depends on how much work you want to do.

BTW, you can also change the Comments without opening the document by
right mouse clicking and selecting the Summary tab. Change the
Comment by clicking the area to the right of the property label. A
text box will appear and you just type your text.

HTHs

Cheers
Shane
 
F

Fern

Thanks Shane!! You read my mind. Here's what I've managed to work out so far:

Dim CommentYesNo, Message As String, Title As String, AddedComment As
Stringm MyFile as string
'Use an inputbox to add any comments/descriptions to the open file
On Error Resume Next
Application.DisplayAlerts = False
MyFile = ActiveDocument.Name
CommentYesNo = MsgBox("Add a comment to this file?", vbYesNo,
AddedComment)
If CommentYesNo = vbYes Then
Message = "Insert comment text:"
Title = "Descriptive comment"
AddedComment = InputBox(Message, Title)
On Error GoTo 0
Application.DisplayAlerts = True

Documents(MyFile).BuiltInDocumentProperties(wdPropertyComments).Value =
AddedComment
Else
Exit Sub
End If

But while the code DOES change the file's comments, those comments don't
show up in the folder's display view.
So what am I doing wrong??

And as an aside, how much more trouble would it be to make these changes on
a CLOSED document??

Thanks again :)
 
S

Shane

Hi Fern.

When I ran your code, saved the document with the comment, and left
the document open in Word the comment didn't display in Explorer.
Close the document, refresh my folder view and bingo. It appeared.

Open the document in Word and the comment isn't displayed in folder
view.

It looks like comments won't appear in the folder while the document
is open in Word.

Moving forward, you're probably better of changing the Comment via
Windows Explorer if you know what the document is all about. Depending
on how many documents are involved you could write some code to cycle
through the documents and display your comment dialog, fill it in and
have that comment added to the document.

Your dialog would be useful in a template if you wanted staff to add a
comment at document creation / save. A custom dialog could target
specific built in or custom document properties with data validation
on the fields.

HTHs
Shane
 
F

Fern

Thanks for double checking that for me. I hadn't caught the need for that
extra step. Plus your post let me find a 2nd problem in my code. But I've now
found a workaround to both... I'd wanted the macro so I could add comments to
copies of files I was archiving in a secondary folder since there might be
more than one copy saved on a given day & some will be more important than
others (which is why I didn't want to do it all in Win Explorer). Anyway,
since I was using FileCopy, the new document never got opened which meant
that the comment never got saved & never showed up in the folder view. So my
solution is to use FileCopy, invisibly open the new copy, add the comment, &
then close the copy - and voila! the comment appears in View>Details.
YAY!!!

Thanks for your great help Shane!! I really appreciate it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top