How do you substring a MERGEFIELD in Word?
Asked Answered
S

1

6

This one has me puzzled. It seemed like an easy task, but the solution eludes me: - How do you substring a merge field in a Word template used for mail merging?

For example, I have something like {MERGEFIELD barcodevalue} and I want to extract the first 6 characters as it is at the same time an identifier for something else.

I can find information on how to remove chars to the left of a given position in a numerical field (\x) but not to the right.

Stalagmite answered 15/12, 2008 at 8:22 Comment(0)
K
3

What is the data provider for your mail merge data? If it is an SQL query you could use the substr/substring function of SQL.

Anyway it might be easier to change your source data/query instead of tweaking mailmerge fieldcodes, which seems to be limited.

Krenn answered 15/12, 2008 at 10:10 Comment(2)
The Datasource is a CSV file, generated from a program I have no control over.Stalagmite
How about pre-processing the generated CSV file, e.g. using an external tool?Krenn

© 2022 - 2024 — McMap. All rights reserved.