Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista Tutorial - Assign a Comment

Reply
 
Old 08-10-2008   #1 (permalink)
Gary''s Student
Guest


 
 

Assign a Comment

I can manually assign a comment to a file (say a Word doc) by:

1. right-clicking the icon
2. selecting properties
3. selecting the Summary tab
4. typing in the comment

Can I do the same thing with a script??
--
Gary''s Student - gsnu2007xx

My System SpecsSystem Spec
Old 08-10-2008   #2 (permalink)
Pegasus \(MVP\)
Guest


 
 

Re: Assign a Comment


"Gary''s Student" <GarysStudent@xxxxxx> wrote in message
news:99A634DF-BB32-4992-A7C1-0FE1FD6E62C1@xxxxxx
Quote:

>I can manually assign a comment to a file (say a Word doc) by:
>
> 1. right-clicking the icon
> 2. selecting properties
> 3. selecting the Summary tab
> 4. typing in the comment
>
> Can I do the same thing with a script??
> --
> Gary''s Student - gsnu2007xx
An MS Word file is in essence a binary file composed of a
mixture of text and binary code that controls how the text
should appear on the screen.

A VB Script file is a pure text file. There is no room for binary
control code in it. However, you can add comments by inserting
a single quote like so:

wscript.echo "My Name is Gary" 'Console output


My System SpecsSystem Spec
Old 08-10-2008   #3 (permalink)
Gary''s Student
Guest


 
 

Re: Assign a Comment

First, thanks for responding.
Second, let me apologize for my mis-leading query.

Here is an manual example of what I want the script to do

1. I created a script called "search.vbs"
2. the script contained the following two lines:

Set wshshell = CreateObject("Shell.Application")
wshshell.findfiles

3. I opened the folder containing the file, right-clicked the file, selected
properties, selected the Summary tab, and entered this comment:

"This script will bring up Windows Desktop Search"

If I now mouse-over the icon, the comment pops up.
If I select Comments in the Details view of the folder, the comment is
displayed.

The filetype, how I created it, or its contents are not important. I am
only concerned with the assignment of the comment. The assignment of the
comment was manual. I had to manually enter it thru Properties.

I want to know if I can assign a comment to a file with a script ( the step
3 part).

b.t.w your previous assistance with my mapped drive problem worked very well!


--
Gary''s Student - gsnu2007xx


"Pegasus (MVP)" wrote:
Quote:

>
> "Gary''s Student" <GarysStudent@xxxxxx> wrote in message
> news:99A634DF-BB32-4992-A7C1-0FE1FD6E62C1@xxxxxx
Quote:

> >I can manually assign a comment to a file (say a Word doc) by:
> >
> > 1. right-clicking the icon
> > 2. selecting properties
> > 3. selecting the Summary tab
> > 4. typing in the comment
> >
> > Can I do the same thing with a script??
> > --
> > Gary''s Student - gsnu2007xx
>
> An MS Word file is in essence a binary file composed of a
> mixture of text and binary code that controls how the text
> should appear on the screen.
>
> A VB Script file is a pure text file. There is no room for binary
> control code in it. However, you can add comments by inserting
> a single quote like so:
>
> wscript.echo "My Name is Gary" 'Console output
>
>
>
My System SpecsSystem Spec
Old 08-10-2008   #4 (permalink)
urkec
Guest


 
 

Re: Assign a Comment

"Gary''s Student" wrote:
Quote:

> First, thanks for responding.
> Second, let me apologize for my mis-leading query.
>
> Here is an manual example of what I want the script to do
>
> 1. I created a script called "search.vbs"
> 2. the script contained the following two lines:
>
> Set wshshell = CreateObject("Shell.Application")
> wshshell.findfiles
>
> 3. I opened the folder containing the file, right-clicked the file, selected
> properties, selected the Summary tab, and entered this comment:
>
> "This script will bring up Windows Desktop Search"
>
> If I now mouse-over the icon, the comment pops up.
> If I select Comments in the Details view of the folder, the comment is
> displayed.
>
> The filetype, how I created it, or its contents are not important. I am
> only concerned with the assignment of the comment. The assignment of the
> comment was manual. I had to manually enter it thru Properties.
>
> I want to know if I can assign a comment to a file with a script ( the step
> 3 part).
>
> b.t.w your previous assistance with my mapped drive problem worked very well!
>
>
> --
> Gary''s Student - gsnu2007xx
>
>
> "Pegasus (MVP)" wrote:
>
Quote:

> >
> > "Gary''s Student" <GarysStudent@xxxxxx> wrote in message
> > news:99A634DF-BB32-4992-A7C1-0FE1FD6E62C1@xxxxxx
Quote:

> > >I can manually assign a comment to a file (say a Word doc) by:
> > >
> > > 1. right-clicking the icon
> > > 2. selecting properties
> > > 3. selecting the Summary tab
> > > 4. typing in the comment
> > >
> > > Can I do the same thing with a script??
> > > --
> > > Gary''s Student - gsnu2007xx
> >
> > An MS Word file is in essence a binary file composed of a
> > mixture of text and binary code that controls how the text
> > should appear on the screen.
> >
> > A VB Script file is a pure text file. There is no room for binary
> > control code in it. However, you can add comments by inserting
> > a single quote like so:
> >
> > wscript.echo "My Name is Gary" 'Console output
> >
> >
> >

If you have Word installed, you can use it's object model to acces
Document.BuiltInDocumentProperties collection and assign a value to it's
members.


--
urkec
My System SpecsSystem Spec
Old 08-10-2008   #5 (permalink)
Ildhund
Guest


 
 

Re: Assign a Comment

"Gary''s Student" <GarysStudent@xxxxxx> wrote in
message news:F3E988CA-3708-4ADF-9B74-42812F79CDE9@xxxxxx
....
Quote:

> The filetype, how I created it, or its contents are not important.
> I am only concerned with the assignment of the comment. The
> assignment of the
> comment was manual. I had to manually enter it thru Properties.
>
> I want to know if I can assign a comment to a file with a script
> ( the step 3 part).
You want dsofile: see http://support.microsoft.com/kb/224351. Chip
Pearson has some typically thorough code (much of it specifically
designed for XL workbooks) for download at
http://www.cpearson.com/excel/DocProp.aspx

I'm not sure, but I think that any file type that has a Summary tab
on its Properties sheet in Explorer can have its properties read and
written using dsofile.dll.
--
Noel

My System SpecsSystem Spec
Old 08-10-2008   #6 (permalink)
Gary''s Student
Guest


 
 

Re: Assign a Comment

Great idea!!

This actually works. I use DIR to get the list of files. Then I can use
the extensions to get the right application. Then I use CreateObject and Set
to get to the appropriate application's Object Model for the file in
question.

A nearly perfect blend of WSH and VBA.

I am still having some problems with some non-Office filetypes, but the end
is in sight.

Thanks again.
--
Gary''s Student - gsnu200799


"urkec" wrote:
Quote:

> "Gary''s Student" wrote:
>
Quote:

> > First, thanks for responding.
> > Second, let me apologize for my mis-leading query.
> >
> > Here is an manual example of what I want the script to do
> >
> > 1. I created a script called "search.vbs"
> > 2. the script contained the following two lines:
> >
> > Set wshshell = CreateObject("Shell.Application")
> > wshshell.findfiles
> >
> > 3. I opened the folder containing the file, right-clicked the file, selected
> > properties, selected the Summary tab, and entered this comment:
> >
> > "This script will bring up Windows Desktop Search"
> >
> > If I now mouse-over the icon, the comment pops up.
> > If I select Comments in the Details view of the folder, the comment is
> > displayed.
> >
> > The filetype, how I created it, or its contents are not important. I am
> > only concerned with the assignment of the comment. The assignment of the
> > comment was manual. I had to manually enter it thru Properties.
> >
> > I want to know if I can assign a comment to a file with a script ( the step
> > 3 part).
> >
> > b.t.w your previous assistance with my mapped drive problem worked very well!
> >
> >
> > --
> > Gary''s Student - gsnu2007xx
> >
> >
> > "Pegasus (MVP)" wrote:
> >
Quote:

> > >
> > > "Gary''s Student" <GarysStudent@xxxxxx> wrote in message
> > > news:99A634DF-BB32-4992-A7C1-0FE1FD6E62C1@xxxxxx
> > > >I can manually assign a comment to a file (say a Word doc) by:
> > > >
> > > > 1. right-clicking the icon
> > > > 2. selecting properties
> > > > 3. selecting the Summary tab
> > > > 4. typing in the comment
> > > >
> > > > Can I do the same thing with a script??
> > > > --
> > > > Gary''s Student - gsnu2007xx
> > >
> > > An MS Word file is in essence a binary file composed of a
> > > mixture of text and binary code that controls how the text
> > > should appear on the screen.
> > >
> > > A VB Script file is a pure text file. There is no room for binary
> > > control code in it. However, you can add comments by inserting
> > > a single quote like so:
> > >
> > > wscript.echo "My Name is Gary" 'Console output
> > >
> > >
> > >
>
>
> If you have Word installed, you can use it's object model to acces
> Document.BuiltInDocumentProperties collection and assign a value to it's
> members.
>
>
> --
> urkec
My System SpecsSystem Spec
Old 08-10-2008   #7 (permalink)
Gary''s Student
Guest


 
 

Re: Assign a Comment

Thank you very much. i am going to experiment with this tomorrow. It looks
like I may be able to set the comment without even opening the file.
--
Gary''s Student - gsnu2007xx


"Ildhund" wrote:
Quote:

> "Gary''s Student" <GarysStudent@xxxxxx> wrote in
> message news:F3E988CA-3708-4ADF-9B74-42812F79CDE9@xxxxxx
> ....
Quote:

> > The filetype, how I created it, or its contents are not important.
> > I am only concerned with the assignment of the comment. The
> > assignment of the
> > comment was manual. I had to manually enter it thru Properties.
> >
> > I want to know if I can assign a comment to a file with a script
> > ( the step 3 part).
>
> You want dsofile: see http://support.microsoft.com/kb/224351. Chip
> Pearson has some typically thorough code (much of it specifically
> designed for XL workbooks) for download at
> http://www.cpearson.com/excel/DocProp.aspx
>
> I'm not sure, but I think that any file type that has a Summary tab
> on its Properties sheet in Explorer can have its properties read and
> written using dsofile.dll.
> --
> Noel
>
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Can't assign default program Vista General
Assign user files Vista account administration
Assign playback to WMP Vista music pictures video
How assign extension to app? Vista General
Cannot assign drive letter Vista installation & setup


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46