Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 28 of 28

Thread: Mail Merge with conditonal parameters

  1. #21
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    Well, there is no way the merge can possibly process data that is input afterwards.

    I'll see if I can knock up a working model, subject to the specialisms being in the merge data, of course.
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  2. #22
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    I posted the code for this, using bookmarks. Go back and look at it again. The paragraphs to be deleted have to be bookmarked as well.

  3. #23
    Quote Originally Posted by TonyJollans
    Well, there is no way the merge can possibly process data that is input afterwards.

    I'll see if I can knock up a working model, subject to the specialisms being in the merge data, of course.

    Quote Originally Posted by fumei
    I posted the code for this, using bookmarks. Go back and look at it again. The paragraphs to be deleted have to be bookmarked as well.
    Ok guys, we are completely miscommunicating here. First Gerry, yes, I saw the code for deleting paragraphs and yes it works (sort of) - thank you for that. But I posted back to this thread because,

    #1) I wanted to clarify if Tony was talking about the "IF" conditional mail merge feature and if so, how to use that for my purposes.

    #2) Your code works for only one keyword. If you see my posting from earlier today, there is not just one keyword involved here - but often several of them. So again - referring to my posting from today, you'll see that there can be a combination of several different keywords and based on that, some paragraphs remain and some paragraphs get removed.

    Furthermore, upon examination I think your code is effectively for 1 single document. Does it really work for a merged document of consisting of several records??

    Tony, I realize what you are saying. I'm not looking to merge data that in the manner you think. What I do is AFTER the mail merge, I enter in the transplant type (we'll call it the keyword) for each merged record at the end of paragraph #1. Then manually BY HAND, I delete certain paragraphs and sentences based on those keywords. Notice I said keywords because often times it's a combination of the 2 categories which I explained in my posting today.

    I really don't know how else to explain my project here. We are going around in circles?

  4. #24
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    We are going around in circles.

    My code was for the purposes of getting things started, sooooooo

    1. Of course it is for one document. The document after the mail merge IS one document.

    2. Adding several keywords is simply expanding the code. You can effectively making any combinations you want.

    JohnnyBravo, this is a question of LOGIC. Get your logic right and then the coding will eventually work out.

    The LOGIC is:

    an input parameter determines if specific paragraphs are deleted, oir not.

    The code does exactly that. Now if you have multiple parameters...that is OK. You just build the logic structure to deal with it. However, the basic logic remains the same. A parameter deternines if specific paragraphs are deleted. For the logic to work the specific paragraphs have to be specified. How could it be otherwise? Therefore the specific paragraphs need to be bookmarked.

    Tony is talking about the IF within the merge, and YOU are talking about logic (an IF) after the merge. As Tony posted, these are different.

  5. #25
    Moderator VBAX Master geekgirlau's Avatar
    Joined
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,464
    Location
    The IF merge code will ONLY work if the transplant type is part of your data source. I would question WHY you would want to manually enter a value after performing the merge, however there may be some reason for this that is not apparent to the uninitiated!

  6. #26
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    Quote Originally Posted by JohnnyBravo
    What I do is AFTER the mail merge, I enter in the transplant type (we'll call it the keyword) for each merged record at the end of paragraph #1. Then manually BY HAND, I delete certain paragraphs and sentences based on those keywords. Notice I said keywords because often times it's a combination of the 2 categories which I explained in my posting today.
    For this process, after the mail merge, you will need some code - I don't know if it's easier to add or remove paragraphs - I think, probably, adding is easier if you set up some Autotext entries.

    But I'm interested. What criteria do you use for adding the transplant type? Even if it has to be a manual process, could it not be (manually) added to the data source before the merge? (And what format is the data source?)
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  7. #27
    Well I apologize for causing such mass confusion - I did not mean to.

    The data source that contains all the addressee's contact information is in an Access database. Since it does not contain the transplant type information, I have been been manually typing that in after the mail merge. Long and totally inefficient I know.

    This is a temp job so I have not been given all the tools I need to do this effectively. I have been told that the there is a database that does contain the transplanty type for the respective hospitals we deal with but that is in yet another Access database which I am not privy to. If that was the case, this thread would have been solved in a heartbeat considering the expertise among you.

    Sad but true - I think will have to let this thread die unless I can convince my supervisor to give me access to that database. I really appreciate everyone coming to this thread and helping out. You guys are nice to donate your time & efforts to all the people that come here seeking free help.

  8. #28
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    Do you have update authority to the Access database? No it doesn't matter - do you have Access? If so, create a new database and add a table of hospitals with transplant types, link to all the tables in the other database (you must have read access to it or you couldn't run the merge), create a query joining the two together and base your mail merge on that query. I'm going out again shortly but will try and post a sample in the morning.
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •