Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
ben_johnson1991 ben_johnson1991 is offline
external usenet poster
 
Posts: 1
Default Using mail merge to distinguish colours in Word

I'm using a mail merge from Excel. I dont think this is possible but its
worth a try.
I want colours that are listened in excel to be able to represent a colour
of a text box in word.

example.
The title could be "Tree" and in the colour associated in the excel sheet
would be "Green", so in word when the mail merge is run to put "Tree" into a
text box and i would like somehow for word to recognise "green" and then make
that text box background colour green.

Any help would be great, even if its that it's not possible.
Thanks
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Using mail merge to distinguish colours in Word

It is not possible with mailmerge. It can probably be done by the use of a
macro that automates Word from Excel or vice versa.

--
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, originally posted via msnews.microsoft.com
"ben_johnson1991" wrote in message
...
I'm using a mail merge from Excel. I dont think this is possible but its
worth a try.
I want colours that are listened in excel to be able to represent a colour
of a text box in word.

example.
The title could be "Tree" and in the colour associated in the excel sheet
would be "Green", so in word when the mail merge is run to put "Tree" into
a
text box and i would like somehow for word to recognise "green" and then
make
that text box background colour green.

Any help would be great, even if its that it's not possible.
Thanks


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Using mail merge to distinguish colours in Word

I do not think you will be able to colour the textboxes using the
out-of-the-box merge facilities.

One way would be to post-process the output document using VBA, e.g.

Sub colourmytextboxes()
Dim shp As Word.Shape
With ActiveDocument
For Each shp In .Shapes
' only process Shapes that may have text..
If Not (shp.TextFrame Is Nothing) Then
' ..and do have text
If shp.TextFrame.HasText Then
Select Case UCase(Left(shp.TextFrame.TextRange.Text,
Len(shp.TextFrame.TextRange.Text) - 1))
Case "RED"
' or use RGB values
shp.Fill.ForeColor = vbRed
Case "GREEN"
shp.Fill.ForeColor = vbGreen
Case "BLUE"
shp.Fill.ForeColor = vbBlue
' etc.
Case Else
' do nothing
End Select
End If
End If
Next
End With
End Sub

If you are merging directly to email, you would have to do that using
the Word Mailmerge Events rather than postprocessing.


Peter Jamieson

http://tips.pjmsn.me.uk

ben_johnson1991 wrote:
I'm using a mail merge from Excel. I dont think this is possible but its
worth a try.
I want colours that are listened in excel to be able to represent a colour
of a text box in word.

example.
The title could be "Tree" and in the colour associated in the excel sheet
would be "Green", so in word when the mail merge is run to put "Tree" into a
text box and i would like somehow for word to recognise "green" and then make
that text box background colour green.

Any help would be great, even if its that it's not possible.
Thanks

  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Using mail merge to distinguish colours in Word

hi ben,

The best you can do with field coding is to approximate what you're after. For example, you could use field coding like:
{IF{MERGEFIELD Colour}= "Blue" "Water"}
{IF{MERGEFIELD Colour}= "Red" "Fire"}
{IF{MERGEFIELD Colour}= "Green" "Grass"}
and colour/highlight the 'Water', 'Fire' and 'Grass' strings with the colour/highlight you want. This will colour/highlight those
text strings, but nothing more. However, these strings can also span multiple paragraphs (not just a single word as I have used) and
could include tables with the cell shading you're after.

--
Cheers
macropod
[Microsoft MVP - Word]


"ben_johnson1991" wrote in message ...
I'm using a mail merge from Excel. I dont think this is possible but its
worth a try.
I want colours that are listened in excel to be able to represent a colour
of a text box in word.

example.
The title could be "Tree" and in the colour associated in the excel sheet
would be "Green", so in word when the mail merge is run to put "Tree" into a
text box and i would like somehow for word to recognise "green" and then make
that text box background colour green.

Any help would be great, even if its that it's not possible.
Thanks


  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Using mail merge to distinguish colours in Word

However, these strings can also span multiple paragraphs (not just a
single word as I have used) and could include tables with the cell shading
you're after.


FWIW they can also include /inline/ textboxes but AFAICS you will then also
always get the "Word cannot update locked fields" problem when merging.

Peter Jamieson

"macropod" wrote in message
...
hi ben,

The best you can do with field coding is to approximate what you're after.
For example, you could use field coding like:
{IF{MERGEFIELD Colour}= "Blue" "Water"}
{IF{MERGEFIELD Colour}= "Red" "Fire"}
{IF{MERGEFIELD Colour}= "Green" "Grass"}
and colour/highlight the 'Water', 'Fire' and 'Grass' strings with the
colour/highlight you want. This will colour/highlight those text strings,
but nothing more. However, these strings can also span multiple paragraphs
(not just a single word as I have used) and could include tables with the
cell shading you're after.

--
Cheers
macropod
[Microsoft MVP - Word]


"ben_johnson1991" wrote in message
...
I'm using a mail merge from Excel. I dont think this is possible but its
worth a try.
I want colours that are listened in excel to be able to represent a
colour
of a text box in word.

example.
The title could be "Tree" and in the colour associated in the excel sheet
would be "Green", so in word when the mail merge is run to put "Tree"
into a
text box and i would like somehow for word to recognise "green" and then
make
that text box background colour green.

Any help would be great, even if its that it's not possible.
Thanks



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
distinguish between hurricane waves and hurricane swell belladonna Microsoft Word Help 2 December 28th 08 09:43 PM
Consistancy with colours in Word 07 Andrea Microsoft Word Help 1 March 27th 08 09:03 AM
Mail-Merge: Can we have master detail relationship or multiple entities in word Mail-Merge? gmax2006 Microsoft Word Help 1 March 28th 07 06:28 PM
Word adds the filename to distinguish templates from regular docu how many template?when we click new doc Microsoft Word Help 1 October 15th 06 11:21 PM
Can you set Pantone colours in Word? Grovernz Microsoft Word Help 1 September 5th 05 03:44 PM


All times are GMT +1. The time now is 10:06 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"