A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

add a random paragraph of text to each of my letters



 
 
Thread Tools Display Modes
  #1  
Old March 22nd, 2010, 05:30 PM posted to microsoft.public.word.mailmerge.fields
benrkay
external usenet poster
 
Posts: 1
Default add a random paragraph of text to each of my letters

Hi, im looking to add a random paragraph of text to each of my letters
in a mail merge. i.e. the first paragraph is one of about 15 different
sets of text that Is chosen at random. Is this possible. thanx
  #2  
Old March 22nd, 2010, 08:22 PM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
Default add a random paragraph of text to each of my letters

It would be at best pseudo-random, but roughly speaking
a. let's suppose you had a document c:\mydoc.doc that contained 14
paragraphs, bookmarked "b0", "b2", "b3",..,"b14"
b. you use something like

{ IF TRUE "{ INCLUDETEXT "c:\\mydoc.doc" "b{ =mod(x, 15) })" }

to include one of those 15 paragraphs (where each pair of {} is a pair
of the special field code braces that ou can isert using ctrl-F9)

Then it's a question of what you can use to (pseudo-)randomise "x". I
suppose I would look for some combination of something in your data
(e.g. a record ID or some other arbitrary datum that you could convert
into a number, either in your data source or using field codes) and
something like a time field such as { TIME \@"ss" } to provide something
that would vary from run to run. Up to you.

With some types of data source, you might be able to return a random
number or pseudo-random number as a field in a query or view, and use
that to make a selection along the general lines I have suggested.

Peter Jamieson

http://tips.pjmsn.me.uk

On 22/03/2010 16:30, benrkay wrote:
Hi, im looking to add a random paragraph of text to each of my letters
in a mail merge. i.e. the first paragraph is one of about 15 different
sets of text that Is chosen at random. Is this possible. thanx

  #3  
Old March 25th, 2010, 07:50 PM posted to microsoft.public.word.mailmerge.fields
dan
external usenet poster
 
Posts: 1,408
Default add a random paragraph of text to each of my letters

Are you using Excel for the source list? If so, it is a simple matter to
create a table, where the first column is 1..15, and the second column the
paragraphs of text. Then, in the list, use the
=VLOOKUP(INT(RAND()*15)+1,ListName,2) formula to pull the paragraph into the
list. Mail Merge as usual.

"benrkay" wrote:

Hi, im looking to add a random paragraph of text to each of my letters
in a mail merge. i.e. the first paragraph is one of about 15 different
sets of text that Is chosen at random. Is this possible. thanx
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.