Getting Imformation from external files

S

Steve

Hi,
I am making a product catalouge for my company and I would like to be able
to automatically update the price and possibly product desrciption from an
external file, based on an entered product code. There would be a layout
like this, with each part being in a new row, I would like the <<sections>>
to be updated from the exteranl file (either .csv, .xls, or .xml).

Part No. XXXXXXXX
<<Auto Update Description for XXXXXXXX>>

Price <<Auto Update Price for XXXXXXXX>>

Part No. YYYYYYYY
<<Auto Update Description for YYYYYYYY>>

Price <<Auto Update Price for YYYYYYYY>>

Thanks in advance
Steve
 
S

Steve

Thanks Suzanne, but I can't see how this will work. I don't have a very good
understanding of fields, anychance you could give me a bit more direction.

Thanks
Steve
 
S

Suzanne S. Barnhill

You create an external document that contains the desired data, bookmarked
appropriately. You insert the IncludeText fields referring to those
bookmarks. When you update the data in the external file, the data in your
document is updated.

Alternatively, you put the data in an Excel file and use a catalog/directory
merge to create the catalog.
 
D

Doug Robbins - Word MVP

Why don't you use a Directory type mail merge?

--
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
 
S

Steve

Thanks for the replies. I don't think the directory mail merge will do what
I need. The exteranl file contains more information than is required and is
not divided into the correct sections. I really need something that will
search the exteranl file for a part no and get the associated information.
The include text field may work, I will do some more reading.

Thanks
Steve
 
D

Doug Robbins - Word MVP

How is the data arranged in the external file?
--
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
 
S

Steve

Hi Doug,
The exteranl file contains data like this:

StockCode,Description,SellingPrice
AF-070-083,Cultiva ATC Power Cable,193
AF-110-0007-01,A5 Rover DUO,29750
AF-110-0007-03,A5 Rover DUO,0
AF-110-0009-01,A5 Rover QUAD,34750

That is the .csv file any way, the XML looks like this:

<FormattedReportObjects>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string"
FieldName="{InvMaster.StockCode}"><ObjectName>StockCode1</ObjectName>
<FormattedValue>AF-070-083</FormattedValue>
<Value>AF-070-083</Value>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string"
FieldName="{InvMaster.Description}"><ObjectName>Description1</ObjectName>
<FormattedValue>Cultiva ATC Power Cable</FormattedValue>
<Value>Cultiva ATC Power Cable</Value>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string"
FieldName="{InvMaster.Supplier}"><ObjectName>Supplier1</ObjectName>
<FormattedValue>NOVA001</FormattedValue>
<Value>NOVA001</Value>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:float"
FieldName="{InvMaster.MaterialCost}"><ObjectName>MaterialCost1</ObjectName>
<FormattedValue>84.18</FormattedValue>
<Value>84.18</Value>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:float"
FieldName="{InvPrice.SellingPrice}"><ObjectName>SellingPrice1</ObjectName>
<FormattedValue>193.00</FormattedValue>
<Value>193.00</Value>
</FormattedReportObject>
</FormattedReportObjects>

with a few higher level objects ommited.

Thanks
Steve
 
D

Doug Robbins - Word MVP

If you use a Directory type mail merge main document in which you insert

Part No. <<StockCode>>¶
<<Description>>¶
Price <<Selling Price>>¶


When you execute that merge to a new document, you will get

Part No. AF-070-083
Cultiva ATC Power Cable
Price 193

Part No. AF-110-0007-01
A5 Rover DUO
Price 29750

Part No. AF-110-0007-03
A5 Rover DUO
Price 0

Part No. AF-110-0009-01
A5 Rover QUAD
Price 34750

--
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
 
S

Steve

Hi Doug,
My only concern with that is that file doesn't contain the parts in the
order I require. For instance AF-110-0007-01 occours before AF-070-083 and
in a different section of the catalouge. I need a way to maintain the
formatting I already have and change the prices and descriptions for the part
numbers already entered.

Thanks
Steve
 
D

Doug Robbins - Word MVP

In that case, you are going to have to either:

1. Insert the description and price by copying each one in turn, the
using Paste>Special and paste as a Link so that it will be updated.

2. Use VBA to iterate through the source, setting the value of document
variables in the catalog and have the values displayed by means of {
DOCVARIABLE varname } fields in the catalog with those fields being updated
by the VBA code so that any changes in the source file are reflected in the
document.

--
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
 

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