Results 1 to 2 of 2

Thread: vb and word

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    hi, here is what iam trying to do
    i want to press a button and automatically save a file in word...... (vb
    sends a ID and when the word file is saved, the filename is that ID that vb
    sends in.. is this possible?)
    and i wanna overwright if that file exists alread..

    any help would be greatly appreciated

  2. #2
    Addicted Member
    Join Date
    Jan 2000
    Location
    Fresno, California, USA
    Posts
    195
    I believe this is close to what you want:


    Dim WordApp As Word.Application

    Kill "Path and Filename"

    'Starting Word
    Set WordApp = New Word.Application
    WordApp.Application.Visible = False

    'Open file
    WordApp.Documents.Open "Path and Filename"

    'Save to path and filename
    WordApp.ActiveDocument.SaveAs "Path and Filename", wdFormatDocument
    WordApp.Documents.Close wdDoNotSaveChanges
    WordApp.Application.Quit
    Set WordApp = Nothing

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