Change semicolon seperated MERGEFIELD to list - ms-word

Is there a way to format the information from a MERGEFIELD into a human readable list?
Input
item1;item2;item3;
Output
item1
item2
item3
or
item1
item2
item3

Mailmerges cannot replace characters in a mergefield with other characters and/or formatting; that would have to be done pre-merge by splitting the data into separate fields so each element can be processed in its own right in the mailmerge main document, or post-merge (e.g. using Find/Replace).

Related

Mailmerge single image into a Word Document based on a cell value

I'd like to include an image into a mail merged word document based on the presence of a single value in a column which contains several values.
e.g. if the cell contains the value BOB insert image, if it contains any other value then do nothing.
Most of the {INCLUDEPICTURE} functionality seems built around including a different image based on a filename matching a cell value.
{INCLUDEPICTURE} "MERGEFIELD Selection_identifier).png"\*
MERGEFORMAT \d }
Works provided I translate selection_identifer in the spreadsheet itself, but there has to be a better way. There seems to be little information about this particular usecase online.
If you are only using a single image and it does not vary between merges, you should probably just use
{ IF "{ MERGEFIELD Selection_identifier }" = "BOB" "<the_image>" }
where <the_image> is a copy of the actual image, sized how you want, pasted between those quotation marks. In that case, there would be no need for an INCLUDEPICTURE field or a reference to an external image file.
As usual, all the {} have to be the special field code brace pairs that you can insert on Windows Desktop Word using Carl-F9 or similar.

Replacing a list of words in MS Word

In MS Word, I would like to do a word-to-word translation which involves a list (MS Excel or anything else) of professional vocab with a translated vocab, while grammar is ignored.
Let say, I have a million-word DOC document. And I have created a list of vocabs (or strings) that Google Translation and others softwares cannot translate with respect to a certain profession. And I have > 1000 words in the list (XLS).
A (Vocab) B (Translation)
1 qwertyuiop ABC
2 asdfghjkl DEF
3 zxcvbnm XYZ
What I want is, if I check through the DOC document, where-ever I find "asdfghjkl" (which is A3), it would be replaced into "DEF" (which is B3).
In MS Word, I tried "Replace All" in Ctrl + F, but I have to go through 1000 times if I have 1000 vocabs to be translated. How can I, within MS Word (VBA??) or from a software, replace those vocabs with ease??
Thanks a million!! =)

Mergefield Formatting

How can I format my MERGEFIELD to show a suffix for Kilometers, i.e. "kms".
{MERGEFIELD distance /# kms} doesn't work. It results only in kms and omits the data.
The \# switch is a numeric format switch that requires a formatting code in double quotation marks. Once the formatting code is in place, the additional text can be added in single quotation marks. As such, this code:
{ MERGEFIELD Distance \# "# 'kms' " }
will append "kms" to any raw number (no commas, decimal point, or other formatting). To see a comprehensive explanation of formatting field codes that includes additional formatting options, please refer to Insert and format field codes in Word 2010 (or the equivalent article for other versions of Word).

Conditional Formatting Char vs Numeric in String

I'm trying to do some simple formatting in crystal reports like:
String:
John Smith 212-212-2121
Where the A-Z would be one color and 0-9 would be a different color
I tried this
if NumericText ({myString})
then crRed else crNavy
Any ideas on how to do this ?
As far as I'm aware, you can't have multiple colors in a single string.
You've got a couple of ways of doing this, but they're both kind of clunky, and your string as-is will need to either be parsed or reformatted.
Split your string into two separate formula fields. Color the name field the appropriate color, and the phone number field with the appropriate color, and stick both of these fields into another textbox field. It should look something like this crudely drawn example:
[ [Name formula field] [Phone formula field] ]
Change your string to use HTML, and then format your textbox to use a Text Interpretation of HTML. I can't say this will work 100%, though, because Crystal Reports only supports some HTML.
In any case, your new string would look something like:
< font color='red'>John Smith< /font> < font color='blue'>212-212-2121< /font>
Assuming that they are two fields, embed both in a Text Object. You'll be able to change the text formatting of each field to be the desired color.
Another approach: place both fields on the canvas; color as desired. Add a Text Object to the canvas. Drag each field to the Text Object. This should retain the formatting, but I haven't tested it.
It you need to split the text into name and number create two formula fields. Once created, follow the steps listed earlier.

Split a string in SSRS if there is a space in between words

I have a field with multiple words in it. I want to separate the words onto different lines rather than have them separated by spaces.
So for example “Not Great”, I want to put “Not” on 1st line and “Great” on 2nd line, like so:
Not
Great
There could be words with “/” character in between i.e. “Great / Good” where I want to put everything after 1st word in 2nd line and everything after “/” in 3rd line i.e.
Great
/
Good
Basically, whenever there is space, I want split that string into multiple lines. How do I do that in SSRS?
Ok, you want the string broken up into different lines.
Do you mean on separate lines within the same tablix cell?
Thats straightfoward see
http://www.kodyaz.com/articles/reporting-services-add-line-break-between-words-custom-code.aspx
If you mean to split the string so the words are on different Tablix cells one approach would be to use a sub report on a list.
Set the list data set to the original data set containing the multiple word string, pass the string to the sub report as a parameter.
On the sub report pass the parameter to a data set that splits the string into individual lines.
Losts of suggestions for how to do that here
Turning a Comma Separated string into individual rows
Simply replace the space with a carriage return and line feed:
=Replace(Fields!SomeWords.Value, " ", vbCrLf)
=Fields!SomeFields.Value.Replace(Space(1), vbCrLf)