Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
How to add a condition in an includepicture with mergefield
Hi,
I know how to add a varying picture in a mailmerge : {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} (and after the merge CRT A + PF9 to refresh) I know how to add a condition to add or not a field using the "If then else " {IF {MERGEFIELD num} 10 {MERGEFIELD aaa} {MERGEFIELD bbb} } What I want to do, now, is to mix the two and have "beautifulpicture' added ony if num 10 . If I code {IF {MERGEFIELD num} 10 {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} "no picture for this record" } the result is not OK. (the same picture is added (always the first even after CTR A + PF9)). Is somebody can help me, please? Thanks -- tinous |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
How to add a condition in an includepicture with mergefield
Hi tinous,
Try: {IF{MERGEFIELD num} 10 {INCLUDEPICTURE {MERGEFIELD beautifulpicture}}} Cheers "tinous" wrote in message ... Hi, I know how to add a varying picture in a mailmerge : {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} (and after the merge CRT A + PF9 to refresh) I know how to add a condition to add or not a field using the "If then else " {IF {MERGEFIELD num} 10 {MERGEFIELD aaa} {MERGEFIELD bbb} } What I want to do, now, is to mix the two and have "beautifulpicture' added ony if num 10 . If I code {IF {MERGEFIELD num} 10 {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} "no picture for this record" } the result is not OK. (the same picture is added (always the first even after CTR A + PF9)). Is somebody can help me, please? Thanks -- tinous |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
How to add a condition in an includepicture with mergefield
Thanks for your reply.
I've tried, but that doesn't work : nothing appears my code : {IF{MERGEFIELD num} 10 {INCLUDEPICTURE {MERGEFIELD beautifulpicture "no picture needed is that case" }}} if num not 10 : then the texte "no picture needed .." appears if num 10 : then .... nothing (no caractere no picture ...) thanks for your help -- tinous "macropod" wrote: Hi tinous, Try: {IF{MERGEFIELD num} 10 {INCLUDEPICTURE {MERGEFIELD beautifulpicture}}} Cheers "tinous" wrote in message ... Hi, I know how to add a varying picture in a mailmerge : {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} (and after the merge CRT A + PF9 to refresh) I know how to add a condition to add or not a field using the "If then else " {IF {MERGEFIELD num} 10 {MERGEFIELD aaa} {MERGEFIELD bbb} } What I want to do, now, is to mix the two and have "beautifulpicture' added ony if num 10 . If I code {IF {MERGEFIELD num} 10 {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} "no picture for this record" } the result is not OK. (the same picture is added (always the first even after CTR A + PF9)). Is somebody can help me, please? Thanks -- tinous |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
How to add a condition in an includepicture with mergefield
No - that doesn't work. During the merge to a new document the picture from
the conditional statement becomes hard wired into the document and cannot be updated. I can't see a way round this at the moment. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi tinous, Try: {IF{MERGEFIELD num} 10 {INCLUDEPICTURE {MERGEFIELD beautifulpicture}}} Cheers "tinous" wrote in message ... Hi, I know how to add a varying picture in a mailmerge : {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} (and after the merge CRT A + PF9 to refresh) I know how to add a condition to add or not a field using the "If then else " {IF {MERGEFIELD num} 10 {MERGEFIELD aaa} {MERGEFIELD bbb} } What I want to do, now, is to mix the two and have "beautifulpicture' added ony if num 10 . If I code {IF {MERGEFIELD num} 10 {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} "no picture for this record" } the result is not OK. (the same picture is added (always the first even after CTR A + PF9)). Is somebody can help me, please? Thanks -- tinous |
#5
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
How to add a condition in an includepicture with mergefield
what a pity ! I've to manage that pb by an other way.
Thanks for your help tinous -- tinous "Graham Mayor" wrote: No - that doesn't work. During the merge to a new document the picture from the conditional statement becomes hard wired into the document and cannot be updated. I can't see a way round this at the moment. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi tinous, Try: {IF{MERGEFIELD num} 10 {INCLUDEPICTURE {MERGEFIELD beautifulpicture}}} Cheers "tinous" wrote in message ... Hi, I know how to add a varying picture in a mailmerge : {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} (and after the merge CRT A + PF9 to refresh) I know how to add a condition to add or not a field using the "If then else " {IF {MERGEFIELD num} 10 {MERGEFIELD aaa} {MERGEFIELD bbb} } What I want to do, now, is to mix the two and have "beautifulpicture' added ony if num 10 . If I code {IF {MERGEFIELD num} 10 {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} "no picture for this record" } the result is not OK. (the same picture is added (always the first even after CTR A + PF9)). Is somebody can help me, please? Thanks -- tinous |
#6
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
How to add a condition in an includepicture with mergefield
Hi Graham,
Here's a workaround: {INCLUDEPICTURE {IF{MERGEFIELD Num} 10 {MERGEFIELD MergePic} NoMergePic}} where 'NoMergePic' is the name of a file containing the 'no picture for this record' string as an image. For an apparently blank result, you could use a 1-pixel transparent 'NoMergePic'. Cheers "Graham Mayor" wrote in message ... No - that doesn't work. During the merge to a new document the picture from the conditional statement becomes hard wired into the document and cannot be updated. I can't see a way round this at the moment. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi tinous, Try: {IF{MERGEFIELD num} 10 {INCLUDEPICTURE {MERGEFIELD beautifulpicture}}} Cheers "tinous" wrote in message ... Hi, I know how to add a varying picture in a mailmerge : {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} (and after the merge CRT A + PF9 to refresh) I know how to add a condition to add or not a field using the "If then else " {IF {MERGEFIELD num} 10 {MERGEFIELD aaa} {MERGEFIELD bbb} } What I want to do, now, is to mix the two and have "beautifulpicture' added ony if num 10 . If I code {IF {MERGEFIELD num} 10 {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} "no picture for this record" } the result is not OK. (the same picture is added (always the first even after CTR A + PF9)). Is somebody can help me, please? Thanks -- tinous |
#7
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
How to add a condition in an includepicture with mergefield
Hi macropos it's WONDERFULL and open a lot of new possibilities. I can manage
to have one picture or an other depending of switch or what ever. Thanks a lot. Your help is appreciate. Cheers -- tinous "macropod" wrote: Hi Graham, Here's a workaround: {INCLUDEPICTURE {IF{MERGEFIELD Num} 10 {MERGEFIELD MergePic} NoMergePic}} where 'NoMergePic' is the name of a file containing the 'no picture for this record' string as an image. For an apparently blank result, you could use a 1-pixel transparent 'NoMergePic'. Cheers "Graham Mayor" wrote in message ... No - that doesn't work. During the merge to a new document the picture from the conditional statement becomes hard wired into the document and cannot be updated. I can't see a way round this at the moment. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi tinous, Try: {IF{MERGEFIELD num} 10 {INCLUDEPICTURE {MERGEFIELD beautifulpicture}}} Cheers "tinous" wrote in message ... Hi, I know how to add a varying picture in a mailmerge : {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} (and after the merge CRT A + PF9 to refresh) I know how to add a condition to add or not a field using the "If then else " {IF {MERGEFIELD num} 10 {MERGEFIELD aaa} {MERGEFIELD bbb} } What I want to do, now, is to mix the two and have "beautifulpicture' added ony if num 10 . If I code {IF {MERGEFIELD num} 10 {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} "no picture for this record" } the result is not OK. (the same picture is added (always the first even after CTR A + PF9)). Is somebody can help me, please? Thanks -- tinous |
#8
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
How to add a condition in an includepicture with mergefield
Good thinking
-- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi Graham, Here's a workaround: {INCLUDEPICTURE {IF{MERGEFIELD Num} 10 {MERGEFIELD MergePic} NoMergePic}} where 'NoMergePic' is the name of a file containing the 'no picture for this record' string as an image. For an apparently blank result, you could use a 1-pixel transparent 'NoMergePic'. Cheers "Graham Mayor" wrote in message ... No - that doesn't work. During the merge to a new document the picture from the conditional statement becomes hard wired into the document and cannot be updated. I can't see a way round this at the moment. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi tinous, Try: {IF{MERGEFIELD num} 10 {INCLUDEPICTURE {MERGEFIELD beautifulpicture}}} Cheers "tinous" wrote in message ... Hi, I know how to add a varying picture in a mailmerge : {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} (and after the merge CRT A + PF9 to refresh) I know how to add a condition to add or not a field using the "If then else " {IF {MERGEFIELD num} 10 {MERGEFIELD aaa} {MERGEFIELD bbb} } What I want to do, now, is to mix the two and have "beautifulpicture' added ony if num 10 . If I code {IF {MERGEFIELD num} 10 {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} "no picture for this record" } the result is not OK. (the same picture is added (always the first even after CTR A + PF9)). Is somebody can help me, please? Thanks -- tinous |
#9
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
How to add a condition in an includepicture with mergefield
Hi Macropod,
For my purposes I changed your instruction just a little and for my surprise it works much better than I expected {INCLUDEPICTURE {IF{MERGEFIELD photo}="" "X" {MERGEFIELD photo}. It's not necessary to merge to printer, nor to merge to a new document and Ctrl+A and F9. It´s not even necessary to merge, if we simply navigate from one record to another, the picture is updated. The picture is always updated. I think it's great. "macropod" escreveu: Hi Graham, Here's a workaround: {INCLUDEPICTURE {IF{MERGEFIELD Num} 10 {MERGEFIELD MergePic} NoMergePic}} where 'NoMergePic' is the name of a file containing the 'no picture for this record' string as an image. For an apparently blank result, you could use a 1-pixel transparent 'NoMergePic'. Cheers "Graham Mayor" wrote in message ... No - that doesn't work. During the merge to a new document the picture from the conditional statement becomes hard wired into the document and cannot be updated. I can't see a way round this at the moment. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi tinous, Try: {IF{MERGEFIELD num} 10 {INCLUDEPICTURE {MERGEFIELD beautifulpicture}}} Cheers "tinous" wrote in message ... Hi, I know how to add a varying picture in a mailmerge : {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} (and after the merge CRT A + PF9 to refresh) I know how to add a condition to add or not a field using the "If then else " {IF {MERGEFIELD num} 10 {MERGEFIELD aaa} {MERGEFIELD bbb} } What I want to do, now, is to mix the two and have "beautifulpicture' added ony if num 10 . If I code {IF {MERGEFIELD num} 10 {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} "no picture for this record" } the result is not OK. (the same picture is added (always the first even after CTR A + PF9)). Is somebody can help me, please? Thanks -- tinous |
#10
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
How to add a condition in an includepicture with mergefield
Serafim, tell me what kind of database you're using to the mail merge,
because with an Access database, I can't update automaticaly the pictures by navigating from one record to another, I see diferent pictures only if I merge to a new document or to a printer. But if I use a Word table as a source for my mail merge, I can. And another question: If I put pictures inside an Ole object field in a Access database, I can't throw them to the Word's mail merge, I can throw only text (in this case, the Word will see a code like 130021230). Is there a solution? Thanks "Serafim" wrote: Hi Macropod, For my purposes I changed your instruction just a little and for my surprise it works much better than I expected {INCLUDEPICTURE {IF{MERGEFIELD photo}="" "X" {MERGEFIELD photo}. It's not necessary to merge to printer, nor to merge to a new document and Ctrl+A and F9. It´s not even necessary to merge, if we simply navigate from one record to another, the picture is updated. The picture is always updated. I think it's great. "macropod" escreveu: Hi Graham, Here's a workaround: {INCLUDEPICTURE {IF{MERGEFIELD Num} 10 {MERGEFIELD MergePic} NoMergePic}} where 'NoMergePic' is the name of a file containing the 'no picture for this record' string as an image. For an apparently blank result, you could use a 1-pixel transparent 'NoMergePic'. Cheers "Graham Mayor" wrote in message ... No - that doesn't work. During the merge to a new document the picture from the conditional statement becomes hard wired into the document and cannot be updated. I can't see a way round this at the moment. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi tinous, Try: {IF{MERGEFIELD num} 10 {INCLUDEPICTURE {MERGEFIELD beautifulpicture}}} Cheers "tinous" wrote in message ... Hi, I know how to add a varying picture in a mailmerge : {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} (and after the merge CRT A + PF9 to refresh) I know how to add a condition to add or not a field using the "If then else " {IF {MERGEFIELD num} 10 {MERGEFIELD aaa} {MERGEFIELD bbb} } What I want to do, now, is to mix the two and have "beautifulpicture' added ony if num 10 . If I code {IF {MERGEFIELD num} 10 {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} "no picture for this record" } the result is not OK. (the same picture is added (always the first even after CTR A + PF9)). Is somebody can help me, please? Thanks -- tinous |
#11
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
How to add a condition in an includepicture with mergefield
This is normal behaviour - see http://www.gmayor.com/mail_merge_graphics.htm
-- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Anderflash wrote: Serafim, tell me what kind of database you're using to the mail merge, because with an Access database, I can't update automaticaly the pictures by navigating from one record to another, I see diferent pictures only if I merge to a new document or to a printer. But if I use a Word table as a source for my mail merge, I can. And another question: If I put pictures inside an Ole object field in a Access database, I can't throw them to the Word's mail merge, I can throw only text (in this case, the Word will see a code like 130021230). Is there a solution? Thanks "Serafim" wrote: Hi Macropod, For my purposes I changed your instruction just a little and for my surprise it works much better than I expected {INCLUDEPICTURE {IF{MERGEFIELD photo}="" "X" {MERGEFIELD photo}. It's not necessary to merge to printer, nor to merge to a new document and Ctrl+A and F9. It´s not even necessary to merge, if we simply navigate from one record to another, the picture is updated. The picture is always updated. I think it's great. "macropod" escreveu: Hi Graham, Here's a workaround: {INCLUDEPICTURE {IF{MERGEFIELD Num} 10 {MERGEFIELD MergePic} NoMergePic}} where 'NoMergePic' is the name of a file containing the 'no picture for this record' string as an image. For an apparently blank result, you could use a 1-pixel transparent 'NoMergePic'. Cheers "Graham Mayor" wrote in message ... No - that doesn't work. During the merge to a new document the picture from the conditional statement becomes hard wired into the document and cannot be updated. I can't see a way round this at the moment. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi tinous, Try: {IF{MERGEFIELD num} 10 {INCLUDEPICTURE {MERGEFIELD beautifulpicture}}} Cheers "tinous" wrote in message ... Hi, I know how to add a varying picture in a mailmerge : {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} (and after the merge CRT A + PF9 to refresh) I know how to add a condition to add or not a field using the "If then else " {IF {MERGEFIELD num} 10 {MERGEFIELD aaa} {MERGEFIELD bbb} } What I want to do, now, is to mix the two and have "beautifulpicture' added ony if num 10 . If I code {IF {MERGEFIELD num} 10 {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} "no picture for this record" } the result is not OK. (the same picture is added (always the first even after CTR A + PF9)). Is somebody can help me, please? Thanks -- tinous |
#12
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
How to add a condition in an includepicture with mergefield
Graham, before I met this newsgroup, I had seen your site and I liked very
much about fields' math. Thanks for the knowledge. I think your answer is for my second question, about ole object in Access database to a mail merge. And to my first question? Do I get the effect of change the photos automaticaly by navigating between records in a mail merge with an Access database or I only get the photos updated by merging to a new document? If this is the normal behavior, the effect would be an interesting feature to the new office, and also it would be very good if Word recognizes type of the Access fields, because imagine your mail merge with fields about music, like a mail merge about music player, you navigate from one record to another and listen different musics, or different videos, or different charts without using VBA... "Graham Mayor" wrote: This is normal behaviour - see http://www.gmayor.com/mail_merge_graphics.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Anderflash wrote: Serafim, tell me what kind of database you're using to the mail merge, because with an Access database, I can't update automaticaly the pictures by navigating from one record to another, I see diferent pictures only if I merge to a new document or to a printer. But if I use a Word table as a source for my mail merge, I can. And another question: If I put pictures inside an Ole object field in a Access database, I can't throw them to the Word's mail merge, I can throw only text (in this case, the Word will see a code like 130021230). Is there a solution? Thanks "Serafim" wrote: Hi Macropod, For my purposes I changed your instruction just a little and for my surprise it works much better than I expected {INCLUDEPICTURE {IF{MERGEFIELD photo}="" "X" {MERGEFIELD photo}. It's not necessary to merge to printer, nor to merge to a new document and Ctrl+A and F9. It´s not even necessary to merge, if we simply navigate from one record to another, the picture is updated. The picture is always updated. I think it's great. "macropod" escreveu: Hi Graham, Here's a workaround: {INCLUDEPICTURE {IF{MERGEFIELD Num} 10 {MERGEFIELD MergePic} NoMergePic}} where 'NoMergePic' is the name of a file containing the 'no picture for this record' string as an image. For an apparently blank result, you could use a 1-pixel transparent 'NoMergePic'. Cheers "Graham Mayor" wrote in message ... No - that doesn't work. During the merge to a new document the picture from the conditional statement becomes hard wired into the document and cannot be updated. I can't see a way round this at the moment. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi tinous, Try: {IF{MERGEFIELD num} 10 {INCLUDEPICTURE {MERGEFIELD beautifulpicture}}} Cheers "tinous" wrote in message ... Hi, I know how to add a varying picture in a mailmerge : {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} (and after the merge CRT A + PF9 to refresh) I know how to add a condition to add or not a field using the "If then else " {IF {MERGEFIELD num} 10 {MERGEFIELD aaa} {MERGEFIELD bbb} } What I want to do, now, is to mix the two and have "beautifulpicture' added ony if num 10 . If I code {IF {MERGEFIELD num} 10 {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} "no picture for this record" } the result is not OK. (the same picture is added (always the first even after CTR A + PF9)). Is somebody can help me, please? Thanks -- tinous |
#13
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
How to add a condition in an includepicture with mergefield
Most word fields do not automatically update - so you have to force an
update. The simplest way to do this is to merge to a new document and force an update on that document (though merging to the printer directly should work. This is something I never do because my merges are relatively small, and I want to ensure the results are correct before I waste expensive ink.) -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Anderflash wrote: Graham, before I met this newsgroup, I had seen your site and I liked very much about fields' math. Thanks for the knowledge. I think your answer is for my second question, about ole object in Access database to a mail merge. And to my first question? Do I get the effect of change the photos automaticaly by navigating between records in a mail merge with an Access database or I only get the photos updated by merging to a new document? If this is the normal behavior, the effect would be an interesting feature to the new office, and also it would be very good if Word recognizes type of the Access fields, because imagine your mail merge with fields about music, like a mail merge about music player, you navigate from one record to another and listen different musics, or different videos, or different charts without using VBA... "Graham Mayor" wrote: This is normal behaviour - see http://www.gmayor.com/mail_merge_graphics.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Anderflash wrote: Serafim, tell me what kind of database you're using to the mail merge, because with an Access database, I can't update automaticaly the pictures by navigating from one record to another, I see diferent pictures only if I merge to a new document or to a printer. But if I use a Word table as a source for my mail merge, I can. And another question: If I put pictures inside an Ole object field in a Access database, I can't throw them to the Word's mail merge, I can throw only text (in this case, the Word will see a code like 130021230). Is there a solution? Thanks "Serafim" wrote: Hi Macropod, For my purposes I changed your instruction just a little and for my surprise it works much better than I expected {INCLUDEPICTURE {IF{MERGEFIELD photo}="" "X" {MERGEFIELD photo}. It's not necessary to merge to printer, nor to merge to a new document and Ctrl+A and F9. It´s not even necessary to merge, if we simply navigate from one record to another, the picture is updated. The picture is always updated. I think it's great. "macropod" escreveu: Hi Graham, Here's a workaround: {INCLUDEPICTURE {IF{MERGEFIELD Num} 10 {MERGEFIELD MergePic} NoMergePic}} where 'NoMergePic' is the name of a file containing the 'no picture for this record' string as an image. For an apparently blank result, you could use a 1-pixel transparent 'NoMergePic'. Cheers "Graham Mayor" wrote in message ... No - that doesn't work. During the merge to a new document the picture from the conditional statement becomes hard wired into the document and cannot be updated. I can't see a way round this at the moment. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi tinous, Try: {IF{MERGEFIELD num} 10 {INCLUDEPICTURE {MERGEFIELD beautifulpicture}}} Cheers "tinous" wrote in message ... Hi, I know how to add a varying picture in a mailmerge : {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} (and after the merge CRT A + PF9 to refresh) I know how to add a condition to add or not a field using the "If then else " {IF {MERGEFIELD num} 10 {MERGEFIELD aaa} {MERGEFIELD bbb} } What I want to do, now, is to mix the two and have "beautifulpicture' added ony if num 10 . If I code {IF {MERGEFIELD num} 10 {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} "no picture for this record" } the result is not OK. (the same picture is added (always the first even after CTR A + PF9)). Is somebody can help me, please? Thanks -- tinous |
#14
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
How to add a condition in an includepicture with mergefield
At one time, INCLUDEPICTURE fields used to update with much less
intervention than they do now (if I remember correctly). Then MS noticed that malware could theoretically use Word fields to grab data from other parts of a user's system, insert it into a Word document, and capture it. So it altered the behaviour of a number of types of fields, and allowed some control over the behaviour of these fields using the registry key "FieldCalcSecurityLevel" There's a description of some of this in the following KB article: http://support.microsoft.com/kb/330079/en-us One of the things that it mentions is that the behaviour of the INCLUDEPICTURE field differs depending on whether or not you included the \d switch: if you include it, you are much more likely to see your pictures updating because Word does not store the picture information in the .doc and so it is less easy for malware to use that method to transmit infomation about your system. I say "may" simply because I have never tested all possible combinations of e.g. Word version, registry settings, and so on, and other settings generally also come into play. In short - it's one thing to make things work on one system, with one version of Word, until some new update comes along, but it's quite another thing to rely on that approach when you're trying to roll out a reliable solution to end-users (perhaps hundreds or thousands). So I doubt if the type of database you happen to be using to get your image file names from is likely to be relevant, but it might be. As for the whole business of extracting objects from Access databases, I'm not one of the authors of Word or Access so can only speculate why they didn't provide facilities to do it, but a. the chances are that there is insufficient explicit demand from corporate customers, and MS just decided to stick to supporting merging of very simple data types. b. as far as I know, MS has never published the details of how it represents OLE objects within an MS Access database. It has published KB articles that tell you how you can, in some cases, extract certain types of object, but assuming they know the details of how objects are stored within Jet databases, they keep that information to themselves. In addition, just because you have an OLE object in an Access database does not mean that you have an OLE/COM server on your system that is capable of rendering it. If you don't, it may not even be possible to "Anderflash" wrote in message ... Graham, before I met this newsgroup, I had seen your site and I liked very much about fields' math. Thanks for the knowledge. I think your answer is for my second question, about ole object in Access database to a mail merge. And to my first question? Do I get the effect of change the photos automaticaly by navigating between records in a mail merge with an Access database or I only get the photos updated by merging to a new document? If this is the normal behavior, the effect would be an interesting feature to the new office, and also it would be very good if Word recognizes type of the Access fields, because imagine your mail merge with fields about music, like a mail merge about music player, you navigate from one record to another and listen different musics, or different videos, or different charts without using VBA... "Graham Mayor" wrote: This is normal behaviour - see http://www.gmayor.com/mail_merge_graphics.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Anderflash wrote: Serafim, tell me what kind of database you're using to the mail merge, because with an Access database, I can't update automaticaly the pictures by navigating from one record to another, I see diferent pictures only if I merge to a new document or to a printer. But if I use a Word table as a source for my mail merge, I can. And another question: If I put pictures inside an Ole object field in a Access database, I can't throw them to the Word's mail merge, I can throw only text (in this case, the Word will see a code like 130021230). Is there a solution? Thanks "Serafim" wrote: Hi Macropod, For my purposes I changed your instruction just a little and for my surprise it works much better than I expected {INCLUDEPICTURE {IF{MERGEFIELD photo}="" "X" {MERGEFIELD photo}. It's not necessary to merge to printer, nor to merge to a new document and Ctrl+A and F9. It´s not even necessary to merge, if we simply navigate from one record to another, the picture is updated. The picture is always updated. I think it's great. "macropod" escreveu: Hi Graham, Here's a workaround: {INCLUDEPICTURE {IF{MERGEFIELD Num} 10 {MERGEFIELD MergePic} NoMergePic}} where 'NoMergePic' is the name of a file containing the 'no picture for this record' string as an image. For an apparently blank result, you could use a 1-pixel transparent 'NoMergePic'. Cheers "Graham Mayor" wrote in message ... No - that doesn't work. During the merge to a new document the picture from the conditional statement becomes hard wired into the document and cannot be updated. I can't see a way round this at the moment. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi tinous, Try: {IF{MERGEFIELD num} 10 {INCLUDEPICTURE {MERGEFIELD beautifulpicture}}} Cheers "tinous" wrote in message ... Hi, I know how to add a varying picture in a mailmerge : {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} (and after the merge CRT A + PF9 to refresh) I know how to add a condition to add or not a field using the "If then else " {IF {MERGEFIELD num} 10 {MERGEFIELD aaa} {MERGEFIELD bbb} } What I want to do, now, is to mix the two and have "beautifulpicture' added ony if num 10 . If I code {IF {MERGEFIELD num} 10 {INCLUDEPICTURE MERGEFORMAT {MERGEFIELD beautifulpicture}} "no picture for this record" } the result is not OK. (the same picture is added (always the first even after CTR A + PF9)). Is somebody can help me, please? Thanks -- tinous |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
mail merge with 2 different last names to the same address | Mailmerge | |||
Supress blank lines | Mailmerge | |||
formatting from a database in Word 2003 | Mailmerge | |||
How do I insert different pictures using and If statement in Word. | Mailmerge | |||
includepicture From URL + Mergefield | Mailmerge |