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 / September 2005

Tip: Looking for answers? Try searching our database.

mailmerging glossary terms into doc

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MrSWF - 11 Sep 2005 10:21 GMT
Hi,

I need to create some kind of mailmerge that links a Word doc to a single
file (Excel, Access, whatever) which contains an extensive glossary, and let
the user pick wich terms from that glossary want to include in the active doc.

Any help will be much appreciated.

MrSWF
Doug Robbins - 11 Sep 2005 11:09 GMT
I would create a userform containing a multiselect listbox that would be
populated with all of the items.  The user could then select from the
listbox the items to be included.  The following routine will load such a
listbox

Private Sub UserForm_Initialize()

   Dim db As DAO.Database

   Dim rs As DAO.Recordset

   Dim NoOfRecords As Long

   ' Open the database

   Set db = OpenDatabase("D:\Access\ResidencesXP.mdb")

   ' Retrieve the recordset

   Set rs = db.OpenRecordset("SELECT * FROM Owners")

   ' Determine the number of retrieved records

   With rs

        .MoveLast

        NoOfRecords = .RecordCount

        .MoveFirst

   End With

   ' Set the number of Columns = number of Fields in recordset

   ListBox1.ColumnCount = rs.Fields.Count

   ' Load the ListBox with the retrieved records

   ListBox1.Column = rs.GetRows(NoOfRecords)

   ' Cleanup

   rs.Close

   db.Close

   Set rs = Nothing

   Set db = Nothing

End Sub

and to for the code to determine which items are selected, See the article
"How to find out which Items are selected in a Multi-Select ListBox" at:

http://www.word.mvps.org/FAQs/Userforms/GetMultiSelectValues.htm

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

> Hi,
>
[quoted text clipped - 7 lines]
>
> MrSWF
 
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.