Currently I have a button on a Access 'form' (cmdFDA) that opens a specific word doc (FDA.doc) and populates a table on that doc with info from my Access form.
I would like to have VBA that forces the word doc to open with a unique filename.
Restrictions: I cannont have it open as a Read-Only. I cannot write VBA in MS Word
Thank you very much for your help!!!
Below is a short version of my code so far.
Private Sub cmdFDA_Click()
'Open FDA with POC Fields populated.
Dim appWord As Word.Application
Dim doc As Word.Document
'Avoid error 429, when Word isn't open.
On Error Resume Next
'Set appWord object variable to running instance of Word.
Set appWord = GetObject(, "Word.Application")
If Err.Number <> 0 Then
'If Word isn't open, create a new instance of Word.
Set appWord = New Word.Application
Set doc = appWord.Documents.Open(":\\FDA_CreateTEST.docx", , True)
.FormFields("Text1").Result = Me!Text58
.FormFields("Text2").Result = Me!Text56
.FormFields("Text3").Result = Me!Text54
.Visible = True
Set doc = Nothing
Set appWord = Nothing
MsgBox Err.Number & ": " & Err.Description