Results 1 to 3 of 3

Thread: (VBA) TransferText: Word to Access

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    49

    Question

    Using VBA in Word97 to code a macro, I am using the DoCmd.TransferText to import a text file into an Access database.

    My problem is - when I run the macro again after the first time, the data appends to my existing table, but I want it to overwrite the existing table.

    Are there any arguments to the TransferText command that overwrites a table if the same table name is specified?

  2. #2
    Addicted Member jeroenh's Avatar
    Join Date
    Aug 2000
    Location
    Rotterdam, Holland
    Posts
    201
    First use the range.select command of the activedocument within word.

    After that you enter your code where the data is transfered.
    This would result in:
    ActiveDocument.Range.Select
    DoCmd.TransferText

    And that should be it.


    Catch you later,

    Jeroen Hoekemeijer
    Code:
    If 1 = 2 Then MajorError

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    49

    Re: TransferText (Word to Access)

    I have managed to export selected text from Word into an Access table, but my problem is everytime I want to do export to the SAME table I want the selected text to OVERWRITE the table and not append the text underneath the existing data.

    I hope that is a little clearer. Any suggestions?

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