Export Records to Word and save file in a specific folder (1 Viewer)

JPR

Registered User.
Local time
Today, 04:54
Joined
Jan 23, 2009
Messages
192
Hello friends, I am back for some other help.
I have some vba which exports data to Word via bookmarks:

<Dim objWord As Object
Set objWord = CreateObject("Word.Application")
objWord.Visible = False
objWord.Documents.Add ("C:\MyDocs\MyTemplate.dot")

objWord.ActiveDocument.Bookmarks("LNAME").Select
objWord.Selection.Text = Me.LNAME

objWord.ActiveDocument.Bookmarks("NAME").Select
objWord.Selection.Text = Me.FNAME

objWord.Visible = True
Set objWord = Nothing>

I was wandering if there is a way to save this Word file directly into the folder in C:\myDocs\My Templates with the name given from the LNAME and FNAME fields.

Thank you
 

Users who are viewing this thread

Top Bottom