How can I import CSV-fields in Custom Properties through Word-VBA in WD2000

  • Thread starter WwIiNnDdOoOoSsREMOVE
  • Start date
W

WwIiNnDdOoOoSsREMOVE

Hello,

I have a Word-template, in which I would like to fill Custom
Properties entries from a CSV-file through a VBA-macro. How should I
do this? I use Word 2000. The file is the layout:

"field1txt","field2txt","field3txt", etc.

I would like to fill these fields in Custom Properties, named:

Field1,Field2,Field3, etc.

Thans in advance for the information.

Windoos
 
B

Bear

Windoos:

If I had already written code for this, I'd be happy to share it with you.
But I have not. I suspect you're not getting any answers because nobody else
has either. It's not terribly difficult, but to do it on a volunteer basis is
asking a lot. (I think.)

In general, you'd need to convert the CSV string (I'm assuming it's stored
in a document) into an array (maybe using the Split function), or create a
loop to get the next element in the string into a variable.

Then you'd need to convert the string into the property name, maybe using
the Mid function.

Then you could use the Add method of the CustomProperties collection to add
the custom property.

Look at the online Help for the CustomProperties collection, read about the
add method, then experiment using constants. Once you can do that, work on
converting your CSV string into the set of variables you'll need.

Bear
 
H

Helmut Weber

Hi Bear,

I'd say, you didn't get an answer,
as nobody was able to make out what you want.
I have a Word-template, in which I would like to fill Custom
Properties entries from a CSV-file through a VBA-macro. How should I
do this? I use Word 2000. The file is the layout:
"field1txt","field2txt","field3txt", etc.
I would like to fill these fields in Custom Properties, named:
Field1,Field2,Field3, etc.

Do you have the custom properties already?
Or do you want to create properties on the fly?

How many are they? Hundreds?
Then all is ill conceived.

Can you open an csv-file
and read its contents into variables or into an array?

What are the contents of the csv-file?
Do the fields contain commas or quotation marks
or expressions like 3/4"-pipe?
Then you'd need to convert the string
into the property name, maybe using the Mid function.

That means you want to create
as many custom document properties as there are fields
in your csv-file?

See above:
I would like to fill Custom
Properties entries from a CSV-file
That means you want to fill existing custom document properties!

Makes no sense to nobody, it seems.


--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
B

Bear

Helmut:

Just to keep you straight, I was not asking this question. I was trying to
give some general guidance to Windoos.

But I agree, his request is a little too broad.

Bear
 
H

Helmut Weber

Hi Bear,

sorry. :)

It comes from same people posting under different names, sometimes.

Helmut Weber
 

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