Putting Tabs in a Mail Merge Field - ms-word

I use MailMerge with CSV file. The below is the format of CSV file.
SerialNo PledgeList
1 0001\t100\t200
So, my value PledgeList field includes \t .
So, Header Record Delimiters Dialog appear to choose field delimiter manually. I have to choose field delimiter manually when opening mailmerge document. So, I would like to know how to do not to appear Delimiter Dialog Box to choose field delimiter manually
Sample letter format is the following
«PAWNERNAME»
«ADDRESS»
Dear «PAWNERNAME»,
«PledgeList»
Yours Sincerely,
I want to include the Tab {PledgeList} in the below data
0001 TAB 1000 TAB 2000

This is a known problem described in a Microsoft Knowledge Base article:
https://support.microsoft.com/en-us/kb/189014
In a nutshell, the solution is to duplicate the Headers line in the CSV file. This confirms the delimiter for Word and should suppress the dialog.
SerialNo PledgeList
SerialNo PledgeList
1 0001\t100\t200
HOWEVER: Word will not automatically interpret \t as a tab sign. It will insert the literal text. You'd need to perform a Find/Replace on the mail merge result. It might be better if you format your data as follows, where the space in the PledgeList is a tab character (ANSI 9):
"SerialNo" "PledgeList"
"SerialNo ""PledgeList"
"1" "0001 100 200"

Related

Creating RTF headings compatible with Microsoft Word

I am producing a script which creates RTF documents and want to add a table of contents. I've opted for this:
{\field\flddirty\fldedit{\*\fldinst TOC}{\fldrslt \i Use this page to add the table of contents, right click to update field \i0}}
and the user will open the RTF in Microsoft Word and update the field. However, I'm unsure of how to format the sections in my RTF code to create headings so that when I update my TOC in Word it will show the sections. For now, when I "update field", I only get "No tables of contents entries found"
I've tried {\tc My heading here} with no luck.
Is there some code I can insert into my RTF to format my text as headers for TOC formatting in Word?
I've figured out how to solve my problem. In Microsoft word, in order for {\tc Heading here } to appear in your table of contents, you must include Table entry fields. To incorporate this into your RTF code, instead of {\*\fldinst TOC} use {\*\fldinst TOC \o \h \f} \h enables HTML links and \f enables table entry fields. Now when you update the field, your {\tc Heading here } will appear in the table of contents.
This article helped me out: https://support.office.com/en-ca/article/Table-of-Contents-III-Use-fields-to-create-a-TOC-and-create-multiple-TOCs-f1509cfe-b48f-4ac5-8241-89a6619d7d6f

How to remove blank space in the starting of every line in crystal report 9 during export to text format

I am using Detail section as one formula by combining required fields in it,
example of Detail formula (using Chr(9) for tab spacing between each field, so that exporting in text would be usable by Mainframe job),
{AccountPool.Name} & Chr(9) &
{#Currency} & Chr(9) &
{Company.Name} & Chr(9) &
{#AcctNum_300000or30002} & Chr(9) &
{#AcctNum_30001} & Chr(9) &
{Account.PoolSide}
Similarly in header also I am using single formula in same way with different text fields.
Issue is, while exporting report to Text format, I am getting a blank space before every line (except header line).
CR will try to preserve the layout of the fields when exporting to text, so if you're seeing white space at the beginning of each line it's because the fields are not flush against the page edge on that side. You can try to move the fields left as far as you can.
Instead, though, I'd recommend you place the fields into the report in the order you want them (not concatenated together in one big formula) and then export it as tab-separated-values, which will strip all the formatting from the report and make it much friendlier to machine read.

LibreOffice Calc: How to convert unformatted text to numbers (or other format)

How do I paste unformatted text (csv or tab delimited for instance) into LibreOffice Calc and then format it as numbers (without editing every cell by hand). When I paste the text below it puts a ' in front of everything so if I try to convert it to a number it's still text.
Text 0.01% 3% 5.1%
Asdf 0.2% 4% 6.0%
So for example if I paste special that as unformatted text with space delimiters and then convert 0.01% to a number (which would then say 0.0001 if it did what I wanted), it now says '0.01% in the cell.
To replace cells with leading single quote: ' (U+0027)
Press CTRL+H » Click More options » Check Regular expressions.
Search for ^.*$ and replace with &
That's kinda RegEx engine hack. It searches for everything before the cell start and replaces it with the existing cell content - but without the single quote. Have a look at the back reference if you want to read more.
This procedure is tested in LibreOffice 4.0.2. Paste as unformatted text, and choose the following options:
Select English as language, or some other language that uses periods as decimal separator.
Select "Detect special numbers".
Now the percentages will be pasted as numbers instead of text, and you can use the format options to display them the way you like.
I insert a column with the function CNUM() and reference to the text value. Then copy special paste: only numbers. Then supress the old column.

Textfile as a datasource for MailMerge in MS Word - how to insert manual linebreak instead of paragraph mark in field?

I have created a textfile as a datasource for a mailmerge in microsoft word. This is working great. Now, i have fields which contains multiline values. When I use this field in the template it creates a "hard" line break (paragraph mark). What does I have to insert into the textfile, that word will creating a "soft" line break (manual line break)?
first:apologize for bad english grammar or vocabulary use.
the way is working with {quote} in ms-word, for example {quote 11} is line break or {quote 12} is page break.
to set it in your document, you should familiar with fields.
press Ctrl+F9 to insert field and then insert "quote ##" (## is any number charchode) in it. then press F9 to Enter and execute.
0x0b (i.e. "Vertical Tab") is probably the only way to do it, but I would check that you don't get document corruption in the output.

How to do search and replace involving fields in Microsoft Word?

I have a Word document with fields of the reference variety, which occur in the form "[field].[field]"--in other words, there's a period between the two fields. I want to globally replace this with a space.
Word offers the ^d special character to search for fields, but for some reason the query "^d.^d" does not find anything. However, ".^d" does. Now comes the problem, however--what do I specify as the replacement text in order to retain the field code? If using regular expressions, I could use a "Find What Expression" such as \1, but with regexp ("wild card") mode the ^d is not permitted.
I guess I could write a macro...
I would like to add to Bibadia's solution.
An example of an index entry field; we want to change a name we misspelled.
Make sure hidden formatting is displayed (toggle with SHIFT+CTRL+F8).
Make sure wildcards option is not selected. To search for fields, use the opening and closing field braces code (optionally use ^w for spaces, as Bibadia suggested):^19 XE "Deo, John" ^21
Replace won't recognize field braces character, but will allow to insert the clipboard's content. ;). To do that, insert in text the correct entry. CTRL+F9 to insert field and type:XE "Doe, John"
Select the field above and copy
Use ^c in the replace box
Hit Replace All
Ta-da!
It's usually better to go the macro route when finding fields because, as you say, the find algorithm that Word uses doesn't work the way you might hope with fields.
But if you know exactly what the fields contain, you can specify a search pattern that will probably work (however not in wildcard mode).
For example, if you want to look for figure number field pairs such as
{ STYLEREF 1 \s }.{ SEQ Figure \* ARABIC \s 1 }
(which would typically be the same set of fields everywhere in the document)
If you only really need to look for the following:
{ STYLEREF 1 \s }.<any field>
you could ensure that field codes are displayed and search for
^d STYLEREF 1 \s ^21.^d
or
^19 STYLEREF 1 \s ^21.^19
If you need to be more precise, you can spell out the second field as well.
"^d" only works for finding the field beginning, not the field end.
It's a shame that ^w wants to find at least 1 whitespace character because otherwise it would be more robust to look for
^19^wSTYLEREF^w1^w\s^w^21.^19
Perhaps someone else knows how to work around that without using wildcards?
Torzaburo,
I suggest that you do this using a macro. You can start by recording the macro, and later refining your processing steps within the macro.
First turn on the hidden characters by navigating to Home > Paragraph > toggle the show/hide Paragraph symbol. Also, select all and toggle the field codes on (right-click and select "Toggle Field Codes".
Open a new blank Word doc in addition to the one you have open. You will use this later. Start the macro recording and find the field using the "^d" (field code) as you said.
When the field is found, copy only the field text within the brackets, and not the full field reference. While the macro is still recording, ALT + TAB to the new blank document and paste the field code in as plain text.
At this point, do the necessary find & replace processing to the field codes. Highlight the processed field codes, copy, ALT + TAB back to the original document, and paste back between the { } brackets.
Stop the macro recording. Add any further custom processing to the macro VBA.
Select-All and re-toggle the field codes. Update the field codes.
You don't need a macro. Just toggle all field codes on by using Alt+F9. Then do a find and replace for what you want to change. Once the replacement is complete, use Alt+F9 again to toggle the field codes back off.
Disclaimer: I didn't originate this solution, but it's clean and elegant and I thought it should be included here:
(Adapted from Search & Replace Field Codes in Word):
Create or find a single instance of the field you want to convert text to
Toggle Field Codes visible (AltF9)
Copy the code for the field you want to use to the Clipboard (highlight and CtrlC)
Open the Replace dialog box (CtrlH), insert the text you want to replace in the Find What box and then enter ^c in the Replace With box.
This will replace your text with the contents of the Clipboard, turning it into the field code you copied in step 3. It also copies formatting information (font, color, etc.), to control how the field will appear when hidden. (Caveat: I've tested this with Word 2003 under Windows 7 only.)
Coming in late on this, probably way too late for Beth (sorry Beth). And this may not be quite what Beth was looking for. But for anyone interested ...
It sounds like Beth may have created captions throughout the document using INSERT CAPTION (hence the presence of field codes). This means these captions will have been (automatically) created in CAPTION style.
To globally replace the separator "." with " " (space) in such captions, take two steps:
[1] Go to REFERENCES | INSERT CAPTION, then click on NUMBERING and replace the SEPARATOR "." with "EM-DASH". This will replace all separators in captions for the selected label in the CAPTION Window. If you have other labels in use in the document (e.g. FIGURE), select the other labels one by one and repeat this process.
[2] Do a find/replace searching for special character "em-dash" (^+) in style CAPTION, replacing with " ". Click REPLACE ALL.
Voila!
NOTE: This presumes that em-dash does not appear in the caption text anywhere. If it does, then you'll need to do a pre- and post- "fiddle" to ensure these em-dashes are not touched by the global replace above.
The "pre-fiddle" is to do a global find/replace across captions, replacing the em-dash ("^+") with some other string (e.g. "EM-DASH") that doesn't ever occur in any caption's text. Then you do the separator change as described above. Finally, the "post-fiddle" is to restore the em-dashes that were in the captions, by doing a global replace of the string "EM-DASH" with the actual em-dash character "^+".