-
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
-
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