Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Merge from Microsoft Business Solutions C5, removing of empty fields
Im running Microsoft Business Solutions C5 (C5), which is an ERP system from
Denmark. C5 has a function that can merge to Word. I use Word 2003. When merging, C5 uses a template, where the merge fields are FORMTEXT fields with a Bookmark. I have tried using IF, THEN, ELSE MERGEFIELDS. But it seems that I can't do that because of the way the merge function is set up in C5. I can however use the bookmarks without the FORMTEXT field. But that doesn't help me in any way. My problem is, that I would like to delete the empty line if one of the MERGE fields is empty. Now I get nasty spaces in the address section, if any of my MERGE fields are empty. Is there a way to use the IF THEN ELSE way, with this kind of merging? Or could I run a macro after the merge is done, that will check all my bookmarks and delete empty lines? Best regards Mads |
#2
|
|||
|
|||
Unfortunately I don't have C5 and I suspect no-one else will be in a good
position to answer. If C5 has created its own merge mechanism, I suspect that your only solution will be to ask C5 for modifications that deal with Word 2003 properly. However, if all they do is open a particular template, attach a particular data source, and perform a standard mail merge, then a. the problem is that in recent versions of Word, blank lines caused by empty fields are not eliminated when those fields are nested within IF fields and INCLUDETEXTed documents. b. you can try doing this manually by putting the necessary paragraph marks /inside/ the IF field results, using e.g. { IF "{ MERGEFIELD line1 }" "" " { MERGEFIELD line1 }" "" }{ IF "{ MERGEFIELD line2 }" "" " { MERGEFIELD line2 }" "" } (i.e. where there is an ordinary paragraph mark immediately after the last " on the first line). Peter Jamieson "Mads W." wrote in message ... Im running Microsoft Business Solutions C5 (C5), which is an ERP system from Denmark. C5 has a function that can merge to Word. I use Word 2003. When merging, C5 uses a template, where the merge fields are FORMTEXT fields with a Bookmark. I have tried using IF, THEN, ELSE MERGEFIELDS. But it seems that I can't do that because of the way the merge function is set up in C5. I can however use the bookmarks without the FORMTEXT field. But that doesn't help me in any way. My problem is, that I would like to delete the empty line if one of the MERGE fields is empty. Now I get nasty spaces in the address section, if any of my MERGE fields are empty. Is there a way to use the IF THEN ELSE way, with this kind of merging? Or could I run a macro after the merge is done, that will check all my bookmarks and delete empty lines? Best regards Mads |
#3
|
|||
|
|||
C5 uses a template and does a DLL merge where it uses bookmarks to search
where to fill in data. So it doesn't really use MERGEFIELDS. The merge only use bookmarks. The DLL file is written to search for bookmarks, and if found fill in data at the given bookmark. Mads W. "Peter Jamieson" skrev i en meddelelse ... Unfortunately I don't have C5 and I suspect no-one else will be in a good position to answer. If C5 has created its own merge mechanism, I suspect that your only solution will be to ask C5 for modifications that deal with Word 2003 properly. However, if all they do is open a particular template, attach a particular data source, and perform a standard mail merge, then a. the problem is that in recent versions of Word, blank lines caused by empty fields are not eliminated when those fields are nested within IF fields and INCLUDETEXTed documents. b. you can try doing this manually by putting the necessary paragraph marks /inside/ the IF field results, using e.g. { IF "{ MERGEFIELD line1 }" "" " { MERGEFIELD line1 }" "" }{ IF "{ MERGEFIELD line2 }" "" " { MERGEFIELD line2 }" "" } (i.e. where there is an ordinary paragraph mark immediately after the last " on the first line). Peter Jamieson "Mads W." wrote in message ... Im running Microsoft Business Solutions C5 (C5), which is an ERP system from Denmark. C5 has a function that can merge to Word. I use Word 2003. When merging, C5 uses a template, where the merge fields are FORMTEXT fields with a Bookmark. I have tried using IF, THEN, ELSE MERGEFIELDS. But it seems that I can't do that because of the way the merge function is set up in C5. I can however use the bookmarks without the FORMTEXT field. But that doesn't help me in any way. My problem is, that I would like to delete the empty line if one of the MERGE fields is empty. Now I get nasty spaces in the address section, if any of my MERGE fields are empty. Is there a way to use the IF THEN ELSE way, with this kind of merging? Or could I run a macro after the merge is done, that will check all my bookmarks and delete empty lines? Best regards Mads |
#4
|
|||
|
|||
Does it do what you want it to do with /any/ version of Word?
Peter Jamieson "Mads W." wrote in message ... C5 uses a template and does a DLL merge where it uses bookmarks to search where to fill in data. So it doesn't really use MERGEFIELDS. The merge only use bookmarks. The DLL file is written to search for bookmarks, and if found fill in data at the given bookmark. Mads W. "Peter Jamieson" skrev i en meddelelse ... Unfortunately I don't have C5 and I suspect no-one else will be in a good position to answer. If C5 has created its own merge mechanism, I suspect that your only solution will be to ask C5 for modifications that deal with Word 2003 properly. However, if all they do is open a particular template, attach a particular data source, and perform a standard mail merge, then a. the problem is that in recent versions of Word, blank lines caused by empty fields are not eliminated when those fields are nested within IF fields and INCLUDETEXTed documents. b. you can try doing this manually by putting the necessary paragraph marks /inside/ the IF field results, using e.g. { IF "{ MERGEFIELD line1 }" "" " { MERGEFIELD line1 }" "" }{ IF "{ MERGEFIELD line2 }" "" " { MERGEFIELD line2 }" "" } (i.e. where there is an ordinary paragraph mark immediately after the last " on the first line). Peter Jamieson "Mads W." wrote in message ... Im running Microsoft Business Solutions C5 (C5), which is an ERP system from Denmark. C5 has a function that can merge to Word. I use Word 2003. When merging, C5 uses a template, where the merge fields are FORMTEXT fields with a Bookmark. I have tried using IF, THEN, ELSE MERGEFIELDS. But it seems that I can't do that because of the way the merge function is set up in C5. I can however use the bookmarks without the FORMTEXT field. But that doesn't help me in any way. My problem is, that I would like to delete the empty line if one of the MERGE fields is empty. Now I get nasty spaces in the address section, if any of my MERGE fields are empty. Is there a way to use the IF THEN ELSE way, with this kind of merging? Or could I run a macro after the merge is done, that will check all my bookmarks and delete empty lines? Best regards Mads |
#5
|
|||
|
|||
I'm using Word 2003. But it also works with Word XP and 2000.
I can upload the template and the DLL, if you can get any information out of that? Mads W. "Peter Jamieson" skrev i en meddelelse ... Does it do what you want it to do with /any/ version of Word? Peter Jamieson "Mads W." wrote in message ... C5 uses a template and does a DLL merge where it uses bookmarks to search where to fill in data. So it doesn't really use MERGEFIELDS. The merge only use bookmarks. The DLL file is written to search for bookmarks, and if found fill in data at the given bookmark. Mads W. "Peter Jamieson" skrev i en meddelelse ... Unfortunately I don't have C5 and I suspect no-one else will be in a good position to answer. If C5 has created its own merge mechanism, I suspect that your only solution will be to ask C5 for modifications that deal with Word 2003 properly. However, if all they do is open a particular template, attach a particular data source, and perform a standard mail merge, then a. the problem is that in recent versions of Word, blank lines caused by empty fields are not eliminated when those fields are nested within IF fields and INCLUDETEXTed documents. b. you can try doing this manually by putting the necessary paragraph marks /inside/ the IF field results, using e.g. { IF "{ MERGEFIELD line1 }" "" " { MERGEFIELD line1 }" "" }{ IF "{ MERGEFIELD line2 }" "" " { MERGEFIELD line2 }" "" } (i.e. where there is an ordinary paragraph mark immediately after the last " on the first line). Peter Jamieson "Mads W." wrote in message ... Im running Microsoft Business Solutions C5 (C5), which is an ERP system from Denmark. C5 has a function that can merge to Word. I use Word 2003. When merging, C5 uses a template, where the merge fields are FORMTEXT fields with a Bookmark. I have tried using IF, THEN, ELSE MERGEFIELDS. But it seems that I can't do that because of the way the merge function is set up in C5. I can however use the bookmarks without the FORMTEXT field. But that doesn't help me in any way. My problem is, that I would like to delete the empty line if one of the MERGE fields is empty. Now I get nasty spaces in the address section, if any of my MERGE fields are empty. Is there a way to use the IF THEN ELSE way, with this kind of merging? Or could I run a macro after the merge is done, that will check all my bookmarks and delete empty lines? Best regards Mads |
#6
|
|||
|
|||
I can upload the template and the DLL, if you can get any information out
of that? Can it be run standalone, i.e. without any other part of C5? But what I really want to know is whether it works the way you want with any version of Word. e.g. does it behave the way you want with Word 2002 but not with Word 2003? Peter Jamieson "Mads W." wrote in message ... I'm using Word 2003. But it also works with Word XP and 2000. I can upload the template and the DLL, if you can get any information out of that? Mads W. "Peter Jamieson" skrev i en meddelelse ... Does it do what you want it to do with /any/ version of Word? Peter Jamieson "Mads W." wrote in message ... C5 uses a template and does a DLL merge where it uses bookmarks to search where to fill in data. So it doesn't really use MERGEFIELDS. The merge only use bookmarks. The DLL file is written to search for bookmarks, and if found fill in data at the given bookmark. Mads W. "Peter Jamieson" skrev i en meddelelse ... Unfortunately I don't have C5 and I suspect no-one else will be in a good position to answer. If C5 has created its own merge mechanism, I suspect that your only solution will be to ask C5 for modifications that deal with Word 2003 properly. However, if all they do is open a particular template, attach a particular data source, and perform a standard mail merge, then a. the problem is that in recent versions of Word, blank lines caused by empty fields are not eliminated when those fields are nested within IF fields and INCLUDETEXTed documents. b. you can try doing this manually by putting the necessary paragraph marks /inside/ the IF field results, using e.g. { IF "{ MERGEFIELD line1 }" "" " { MERGEFIELD line1 }" "" }{ IF "{ MERGEFIELD line2 }" "" " { MERGEFIELD line2 }" "" } (i.e. where there is an ordinary paragraph mark immediately after the last " on the first line). Peter Jamieson "Mads W." wrote in message ... Im running Microsoft Business Solutions C5 (C5), which is an ERP system from Denmark. C5 has a function that can merge to Word. I use Word 2003. When merging, C5 uses a template, where the merge fields are FORMTEXT fields with a Bookmark. I have tried using IF, THEN, ELSE MERGEFIELDS. But it seems that I can't do that because of the way the merge function is set up in C5. I can however use the bookmarks without the FORMTEXT field. But that doesn't help me in any way. My problem is, that I would like to delete the empty line if one of the MERGE fields is empty. Now I get nasty spaces in the address section, if any of my MERGE fields are empty. Is there a way to use the IF THEN ELSE way, with this kind of merging? Or could I run a macro after the merge is done, that will check all my bookmarks and delete empty lines? Best regards Mads |
#7
|
|||
|
|||
It can't be run standalone.
And no, it does have the same flaw with all versions. Mads W. "Peter Jamieson" skrev i en meddelelse ... I can upload the template and the DLL, if you can get any information out of that? Can it be run standalone, i.e. without any other part of C5? But what I really want to know is whether it works the way you want with any version of Word. e.g. does it behave the way you want with Word 2002 but not with Word 2003? Peter Jamieson "Mads W." wrote in message ... I'm using Word 2003. But it also works with Word XP and 2000. I can upload the template and the DLL, if you can get any information out of that? Mads W. "Peter Jamieson" skrev i en meddelelse ... Does it do what you want it to do with /any/ version of Word? Peter Jamieson "Mads W." wrote in message ... C5 uses a template and does a DLL merge where it uses bookmarks to search where to fill in data. So it doesn't really use MERGEFIELDS. The merge only use bookmarks. The DLL file is written to search for bookmarks, and if found fill in data at the given bookmark. Mads W. "Peter Jamieson" skrev i en meddelelse ... Unfortunately I don't have C5 and I suspect no-one else will be in a good position to answer. If C5 has created its own merge mechanism, I suspect that your only solution will be to ask C5 for modifications that deal with Word 2003 properly. However, if all they do is open a particular template, attach a particular data source, and perform a standard mail merge, then a. the problem is that in recent versions of Word, blank lines caused by empty fields are not eliminated when those fields are nested within IF fields and INCLUDETEXTed documents. b. you can try doing this manually by putting the necessary paragraph marks /inside/ the IF field results, using e.g. { IF "{ MERGEFIELD line1 }" "" " { MERGEFIELD line1 }" "" }{ IF "{ MERGEFIELD line2 }" "" " { MERGEFIELD line2 }" "" } (i.e. where there is an ordinary paragraph mark immediately after the last " on the first line). Peter Jamieson "Mads W." wrote in message ... Im running Microsoft Business Solutions C5 (C5), which is an ERP system from Denmark. C5 has a function that can merge to Word. I use Word 2003. When merging, C5 uses a template, where the merge fields are FORMTEXT fields with a Bookmark. I have tried using IF, THEN, ELSE MERGEFIELDS. But it seems that I can't do that because of the way the merge function is set up in C5. I can however use the bookmarks without the FORMTEXT field. But that doesn't help me in any way. My problem is, that I would like to delete the empty line if one of the MERGE fields is empty. Now I get nasty spaces in the address section, if any of my MERGE fields are empty. Is there a way to use the IF THEN ELSE way, with this kind of merging? Or could I run a macro after the merge is done, that will check all my bookmarks and delete empty lines? Best regards Mads |
#8
|
|||
|
|||
OK, I doubt if you will be able to do anything with the data or with the
field layout that will make a difference, but I would try to find some way to mark the document up so that you can easily do Find/Replace to remove unwanted spaces and lines, /after/ the DLL has done its work (as long as it is not printing stuff or e-mailing it straightaway). For example, if their process leaves your bookmarks in place (I doubt if it does though), you might be able to use VBA to check for bookmarks whose text contains a single space and remove them. Or if you want to remove blank lines, use one or more special paragraph style names (perhaps RemoveMeIfBlank1, RemoveMeIfBlank2, and so on), then go through the document removing empty or blank paragraphs with those names. Peter Jamieson "Mads W." wrote in message ... It can't be run standalone. And no, it does have the same flaw with all versions. Mads W. "Peter Jamieson" skrev i en meddelelse ... I can upload the template and the DLL, if you can get any information out of that? Can it be run standalone, i.e. without any other part of C5? But what I really want to know is whether it works the way you want with any version of Word. e.g. does it behave the way you want with Word 2002 but not with Word 2003? Peter Jamieson "Mads W." wrote in message ... I'm using Word 2003. But it also works with Word XP and 2000. I can upload the template and the DLL, if you can get any information out of that? Mads W. "Peter Jamieson" skrev i en meddelelse ... Does it do what you want it to do with /any/ version of Word? Peter Jamieson "Mads W." wrote in message ... C5 uses a template and does a DLL merge where it uses bookmarks to search where to fill in data. So it doesn't really use MERGEFIELDS. The merge only use bookmarks. The DLL file is written to search for bookmarks, and if found fill in data at the given bookmark. Mads W. "Peter Jamieson" skrev i en meddelelse ... Unfortunately I don't have C5 and I suspect no-one else will be in a good position to answer. If C5 has created its own merge mechanism, I suspect that your only solution will be to ask C5 for modifications that deal with Word 2003 properly. However, if all they do is open a particular template, attach a particular data source, and perform a standard mail merge, then a. the problem is that in recent versions of Word, blank lines caused by empty fields are not eliminated when those fields are nested within IF fields and INCLUDETEXTed documents. b. you can try doing this manually by putting the necessary paragraph marks /inside/ the IF field results, using e.g. { IF "{ MERGEFIELD line1 }" "" " { MERGEFIELD line1 }" "" }{ IF "{ MERGEFIELD line2 }" "" " { MERGEFIELD line2 }" "" } (i.e. where there is an ordinary paragraph mark immediately after the last " on the first line). Peter Jamieson "Mads W." wrote in message ... Im running Microsoft Business Solutions C5 (C5), which is an ERP system from Denmark. C5 has a function that can merge to Word. I use Word 2003. When merging, C5 uses a template, where the merge fields are FORMTEXT fields with a Bookmark. I have tried using IF, THEN, ELSE MERGEFIELDS. But it seems that I can't do that because of the way the merge function is set up in C5. I can however use the bookmarks without the FORMTEXT field. But that doesn't help me in any way. My problem is, that I would like to delete the empty line if one of the MERGE fields is empty. Now I get nasty spaces in the address section, if any of my MERGE fields are empty. Is there a way to use the IF THEN ELSE way, with this kind of merging? Or could I run a macro after the merge is done, that will check all my bookmarks and delete empty lines? Best regards Mads |
#9
|
|||
|
|||
My "unmerged" bookmarks remain in the generated document.
So writing a macro that finds the bookmark and deletes it, shouldn't be too hard. But however, I would like to have this macro run without the user has to do anything. Mads W. "Peter Jamieson" skrev i en meddelelse ... OK, I doubt if you will be able to do anything with the data or with the field layout that will make a difference, but I would try to find some way to mark the document up so that you can easily do Find/Replace to remove unwanted spaces and lines, /after/ the DLL has done its work (as long as it is not printing stuff or e-mailing it straightaway). For example, if their process leaves your bookmarks in place (I doubt if it does though), you might be able to use VBA to check for bookmarks whose text contains a single space and remove them. Or if you want to remove blank lines, use one or more special paragraph style names (perhaps RemoveMeIfBlank1, RemoveMeIfBlank2, and so on), then go through the document removing empty or blank paragraphs with those names. Peter Jamieson "Mads W." wrote in message ... It can't be run standalone. And no, it does have the same flaw with all versions. Mads W. "Peter Jamieson" skrev i en meddelelse ... I can upload the template and the DLL, if you can get any information out of that? Can it be run standalone, i.e. without any other part of C5? But what I really want to know is whether it works the way you want with any version of Word. e.g. does it behave the way you want with Word 2002 but not with Word 2003? Peter Jamieson "Mads W." wrote in message ... I'm using Word 2003. But it also works with Word XP and 2000. I can upload the template and the DLL, if you can get any information out of that? Mads W. "Peter Jamieson" skrev i en meddelelse ... Does it do what you want it to do with /any/ version of Word? Peter Jamieson "Mads W." wrote in message ... C5 uses a template and does a DLL merge where it uses bookmarks to search where to fill in data. So it doesn't really use MERGEFIELDS. The merge only use bookmarks. The DLL file is written to search for bookmarks, and if found fill in data at the given bookmark. Mads W. "Peter Jamieson" skrev i en meddelelse ... Unfortunately I don't have C5 and I suspect no-one else will be in a good position to answer. If C5 has created its own merge mechanism, I suspect that your only solution will be to ask C5 for modifications that deal with Word 2003 properly. However, if all they do is open a particular template, attach a particular data source, and perform a standard mail merge, then a. the problem is that in recent versions of Word, blank lines caused by empty fields are not eliminated when those fields are nested within IF fields and INCLUDETEXTed documents. b. you can try doing this manually by putting the necessary paragraph marks /inside/ the IF field results, using e.g. { IF "{ MERGEFIELD line1 }" "" " { MERGEFIELD line1 }" "" }{ IF "{ MERGEFIELD line2 }" "" " { MERGEFIELD line2 }" "" } (i.e. where there is an ordinary paragraph mark immediately after the last " on the first line). Peter Jamieson "Mads W." wrote in message ... Im running Microsoft Business Solutions C5 (C5), which is an ERP system from Denmark. C5 has a function that can merge to Word. I use Word 2003. When merging, C5 uses a template, where the merge fields are FORMTEXT fields with a Bookmark. I have tried using IF, THEN, ELSE MERGEFIELDS. But it seems that I can't do that because of the way the merge function is set up in C5. I can however use the bookmarks without the FORMTEXT field. But that doesn't help me in any way. My problem is, that I would like to delete the empty line if one of the MERGE fields is empty. Now I get nasty spaces in the address section, if any of my MERGE fields are empty. Is there a way to use the IF THEN ELSE way, with this kind of merging? Or could I run a macro after the merge is done, that will check all my bookmarks and delete empty lines? Best regards Mads |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
inserting a photo on a business card in microsoft word? | Microsoft Word Help | |||
microsoft word mail merge | Mailmerge | |||
Is there a way to integrate microsoft office with Business or cus. | Microsoft Word Help | |||
How to change merge forms from Word Perfect to Microsoft Word | Microsoft Word Help | |||
Wnen I try mail merge in Word tp prepare labels I get "microsoft . | Microsoft Word Help |