populate Keywords with a batch file?

R

Rob Benz

I'd like to know how to create a batch file that can store a key word
(including a trailing comma). I'd open an appropriate word.doc, run the
batch file, and that keyword and comma would be inserted in the Keywords
panel, either preceding any existing keywords there, or appended to any
existing keywords there.

So if I had multiple batch files, each embedded with their own unique
keyword and comma, I could invoke certain ones as desired, one after another,
progressively populating my document's keywords panel with multiple keywords
all strung together with comma delimiters.

If I individually compiled those batch files into .exe files, then I could
give each .exe its own name (consisting of the key word embedded in it). Then
I could create a hierarchical, multi-level topical folder structure within My
Documents, and store all my desired key word exe files, according to topic,
in those various folders.

Then I could set my Start Menu to "Expand My Documents".

Now I could open any .doc, use the Start menu to cruise effortlessly through
the maze of topical, hierarchical menus, arrive at any desired key word,
release the mouse, and populate the keyword panel of the open Word.doc. I
could do this, repetitively, to store numerous key words in that document.

I could then share that hierarchical menu structure with our workgroup, so
everyone could use their Start Menus to embed documents with our standardized
set of keywords, without having to do any typing (nor making any typos).

Finally, I could PDF all those Word.docs and index them using Acrobat Pro.
Since Acrobat 'sees' and indexes microsoft word document key words, it would
allow us to employ Acrobat's extremely robust indexed search engine to find
documents based not only on full text search, but also on our embedded key
words.

I could do all this, using nothing more than Windows' Start Menu, NotePad
(for editing the batch file), and a simple batch file-to-.exe compiler.

Just thinking outside of the box....
 
D

Doug Robbins - Word MVP

I am not sure that I would refer to them as batch files, but the code that
you need is:

With ActiveDocument
If .BuiltInDocumentProperties(wdPropertyKeywords) = "" Then
.BuiltInDocumentProperties(wdPropertyKeywords) = "This, is, another,
crazy, idea"
Else
.BuiltInDocumentProperties(wdPropertyKeywords) =
..BuiltInDocumentProperties(wdPropertyKeywords) & ", This, is, another,
crazy, idea"
End If
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
F

Fumei2 via OfficeKB.com

I sure would not refer to them as batch files either. If you are going to be
opening and actioning instructions (as inserting Keywords in a Word document
is) on Word documents, you will need an instance of Word.

So how exactly are these batch files? And how exactly are you going to
compile them into .exe that will use an instance of Word?
I am not sure that I would refer to them as batch files, but the code that
you need is:

With ActiveDocument
If .BuiltInDocumentProperties(wdPropertyKeywords) = "" Then
.BuiltInDocumentProperties(wdPropertyKeywords) = "This, is, another,
crazy, idea"
Else
.BuiltInDocumentProperties(wdPropertyKeywords) =
.BuiltInDocumentProperties(wdPropertyKeywords) & ", This, is, another,
crazy, idea"
End If
End With
I'd like to know how to create a batch file that can store a key word
(including a trailing comma). I'd open an appropriate word.doc, run the
[quoted text clipped - 44 lines]
Just thinking outside of the box....
 
F

Fumei2 via OfficeKB.com

Are you going to use DSOfile?
I sure would not refer to them as batch files either. If you are going to be
opening and actioning instructions (as inserting Keywords in a Word document
is) on Word documents, you will need an instance of Word.

So how exactly are these batch files? And how exactly are you going to
compile them into .exe that will use an instance of Word?
I am not sure that I would refer to them as batch files, but the code that
you need is:
[quoted text clipped - 15 lines]
 

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