Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
WwIiNnDdOoOoSsREMOVE@CAPSfreenet.de - 03 Jan 2006 10:31 GMT
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
Bear - 04 Jan 2006 17:25 GMT
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
Helmut Weber - 04 Jan 2006 21:01 GMT
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.

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

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

Bear - 04 Jan 2006 21:26 GMT
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
Helmut Weber - 04 Jan 2006 21:38 GMT
Hi Bear,

sorry. :-)

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

Helmut Weber
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.