Results 1 to 3 of 3

Thread: Mail merge (yuck)[resolved]

  1. #1

    Thread Starter
    Hyperactive Member thebloke's Avatar
    Join Date
    May 2003
    Posts
    358

    Mail merge (yuck)[resolved]

    Hi guys

    Wasn't really sure where to put this one and not even a coding issue, just thought someone here may know:

    If I do a mail merge, getting the data from an access query, how can I display a value of 'False' from a yes/no field as a different character on the word document? I need to display, say, an 'X' where the value in the table is 'False' and nothing if the value is 'True'.

    Any ideas?!

    Cheers
    Last edited by thebloke; Mar 19th, 2004 at 05:33 AM.
    The Bloke
    www.blokeinthekitchen.com
    making cooking cool for blokes

  2. #2

    Thread Starter
    Hyperactive Member thebloke's Avatar
    Join Date
    May 2003
    Posts
    358
    No? Ok, how about this:

    I put an activeX checkbox on the word document which I want ot wire up to a corresponding field in my mailmerge (the datasource of which is an Access 97 query). How do I do this?!

    Cheers
    The Bloke
    www.blokeinthekitchen.com
    making cooking cool for blokes

  3. #3

    Thread Starter
    Hyperactive Member thebloke's Avatar
    Join Date
    May 2003
    Posts
    358
    Never mind. I've solved it. By inserting a Word Field with an If...Then...Else statement to convert the value of the field inserted by the merge from False to 'X'.

    Incidentally, I was also getting a daft error:

    VB Code:
    1. "Run-time error '2486';"
    2. ("You can't carry out this action at the present time.")

    which, from doing a bit of digging, it seems a lot of people get but I haven't found an answer to.

    I got the error while trying to use docmd in vb6 to run a macro in a word 2002 document which carried out the mail merge and sent it to a printer. In the end, I abandoned this and used the following code:

    VB Code:
    1. public function mailmerge(valIn)
    2. dim strcode as string
    3.  
    4. dim objword as word.document
    5. set objword = getobject("C:\pathwheredocis\" & strcode & ".doc")
    6. objword.application.visible = true
    7. objword.mailmerge.viewmailmergefieldcodes = wdToggle
    8.  
    9. with objword.mailmerge
    10. .destination = wdsendtoprinter
    11. .suppressblanklines = true
    12. with .datasource
    13. .firstrecord = wddefaultfirstrecord
    14. .lastrecord = wddefaultlastrecord
    15. end with
    16. .execute pause:=false
    17. end with
    18.  
    19. objword.close
    20. set objword = nothing
    21. end function

    I hope this information is useful to someone!

    Cheers
    The Bloke
    www.blokeinthekitchen.com
    making cooking cool for blokes

Posting Permissions

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



Click Here to Expand Forum to Full Width