Results 1 to 4 of 4
  1. #1
    AidanH
    Guest

    Automation with Word

    I'm sure this should be easy - but...! I have a database of addresses, with fields called Name, Add1, Add2 etc. What I want to be able to do is send the contents of the first field of the current record to the currently active Word Document at the current cursor location, then put a paragraph mark, the 2nd field, paragraph mark etc. But I can't figure out HOW! Any suggestions?

  2. #2
    Lounger
    Join Date
    Jan 2001
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automation with Word

    Sounds like a pretty straight-forward Mail Merge operation from within Word.

    You just need to separate the Merge Fields in Word with a carriage return. That will give you one field per line, and one document per record.

    Good Luck.

    Rich P.

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automation with Word

    If you want to do it in Access you can use vbCrLf constant.
    In code it should look like this:

    field1 & vbCrLf & field2 & vbCrLf & field3

    It is often easier to do a mailmerge with Word!

  4. #4
    AidanH
    Guest

    Re: Automation with Word

    I obviously didn't explain myself properly - if it was mail merge, I'd be happy - I could even do this AS a mail merge by writing a file from the current record. BUT what I'm trying to do to help a friend is to reach a point where the database can be used to address ANY active document, simply by clicking a button in Access which would send the active record across to the document. I had assumed that creating an object of Word.Application would work, but when I did this yesterday I was getting odd error messages. Today of course, it's working fine so maybe I'm just being paranoid?!

Posting Permissions

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