Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / February 2006

Tip: Looking for answers? Try searching our database.

Need help merging current record.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
oakleyp2 - 21 Feb 2006 19:43 GMT
I would have done a search in the forum but didnt see anyway to do it.

my code below will work if i leave out:
With DataSource
.FirstRecord = Forms!frmGNOA.CurrentRecord
.LastRecord = Forms!frmAGNOA.CurrentRecord
End With

but it does not pull the current record it only gets the first one an
merges it. what do i need to change to make it get the current recor
to merge???

Set oApp = CreateObject("Word.Application")

oApp.Visible = True

Set oDoc = oApp.Documents.Add(conagnoa)

oDoc.MailMerge.OpenDataSource Name:="C:\re\support.mdb", _
Connection:="TABLE tblAGNOA", SQLStatement:="SELECT * FROM [tblAGNOA]"

With oDoc.MailMerge
.Destination = wdSendToNewDocument
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = True

With DataSource
.FirstRecord = Forms!frmGNOA.CurrentRecord
.LastRecord = Forms!frmAGNOA.CurrentRecord
End With

.Execute pause:=True

End With

oDoc.Close savechanges:=wdDoNotSaveChanges
oApp.ScreenUpdating = Tru

--
oakleyp
Posted from - http://www.officehelp.i
Doug Robbins - Word MVP - 22 Feb 2006 05:54 GMT
Why would the current record be anything other than the first record?

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> I would have done a search in the forum but didnt see anyway to do it.
>
[quoted text clipped - 35 lines]
> oDoc.Close savechanges:=wdDoNotSaveChanges
> oApp.ScreenUpdating = True
oakleyp2 - 22 Feb 2006 13:53 GMT
If you have a table that has like 15 records and you want to merge onl
the 5th one

--
oakleyp
Posted from - http://www.officehelp.i
Doug Robbins - Word MVP - 22 Feb 2006 18:50 GMT
But where in your code do you be select a particular record?

See the following page of Bill Gate's look-a-like website at:

http://www.members.shaw.ca/AlbertKallal/wordmerge/index.html

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> If you have a table that has like 15 records and you want to merge only
> the 5th one.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.