S
Someone
Hello
My database has a facility to auto-generate a Word document for a selected
record. The OnClick even runs the following module.
Function WordMerge()
Dim objWord As Word.Document
Set objWord = GetObject("C:\Location....\Template_Name.dot",
"Word.Document")
objWord.Application.Visible = True
objWord.MailMerge.OpenDataSource _
Name:="C:\Location....\db_name.mdb", _
LinkToSource:=True, _
Connection:="TABLE tbl_Direction", _
SQLStatement:="SELECT tbl_Name.field_name, etc, etc, etc, etc FROM
[tbl_Name] WHERE [tbl_Name.Check] = True"
objWord.MailMerge.Execute
With Dialogs(wdDialogFileSaveAs)
.Name = "C:\Location....\Word_Name.doc"
.Show
End With
End Function
The With/End With part is me experimenting and I can get the save as
dialogue box to appear and change the file name. However, I want the file
to atomically save using a specified filename without prompting / user
interaction.
How can I do this?
Thanks
M
My database has a facility to auto-generate a Word document for a selected
record. The OnClick even runs the following module.
Function WordMerge()
Dim objWord As Word.Document
Set objWord = GetObject("C:\Location....\Template_Name.dot",
"Word.Document")
objWord.Application.Visible = True
objWord.MailMerge.OpenDataSource _
Name:="C:\Location....\db_name.mdb", _
LinkToSource:=True, _
Connection:="TABLE tbl_Direction", _
SQLStatement:="SELECT tbl_Name.field_name, etc, etc, etc, etc FROM
[tbl_Name] WHERE [tbl_Name.Check] = True"
objWord.MailMerge.Execute
With Dialogs(wdDialogFileSaveAs)
.Name = "C:\Location....\Word_Name.doc"
.Show
End With
End Function
The With/End With part is me experimenting and I can get the save as
dialogue box to appear and change the file name. However, I want the file
to atomically save using a specified filename without prompting / user
interaction.
How can I do this?
Thanks
M