Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Thread Tools Display Modes
Old 06-18-2010, 01:30 AM
andywal6 andywal6 is offline Select Folder for saving in to Windows XP Select Folder for saving in to Office 2000
Select Folder for saving in to
Join Date: Jun 2010
Posts: 2
andywal6 is on a distinguished road
Default Select Folder for saving in to

I use this vb below to merge and save my documents with a data source created in MS Access.
The data source contains a field named 'FolderNo'
Is it possible to access this field in the data source and insert it programmatically in to the ChangeFileOpenDirectory statement in place of the 'XXXX' useing:
'MailMerge.Fields' or 'Selection.Range, Name:="FolderNo"'
Many thanks in advance.

Private Sub Document_Open()

With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
ChangeFileOpenDirectory "C:\My DataBase\WordQuotes\XXXX"
ActiveDocument.SaveAs FileName:="Thank You Letter.doc", FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
End Sub
Reply With Quote

changefileopendirectory, mailmerge field

Thread Tools
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Select Folder for saving in to Select text by color Invain Word 1 02-14-2010 07:08 AM
Force to select a group of word? jakekei Word 0 01-21-2010 04:20 PM
Select text between characters davers Word 10 05-24-2009 05:15 AM
How to write in Word from Select query lakhan.p Word 0 03-27-2009 07:25 AM
Select Folder for saving in to Select printer to document JosL Office 3 03-07-2009 12:40 PM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 01:17 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd. is not affiliated with Microsoft