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 / Programming / May 2006

Tip: Looking for answers? Try searching our database.

Help with MarkEntry method?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Geoff C - 22 May 2006 11:43 GMT
I'm using an index as an automatic glossary (a tip picked up from another
discussion group), and wanted a macro to simpify adding new entries.  I've
got this far

Sub MarkGlossaryEntry()
If Selection.Type = wdSelectionNormal Then
   ActiveDocument.Indexes.MarkEntry Range:=Selection.Range, _
       Entry:=Selection.Range.Text, CrossReference:= ????? , Italic:=False
End If
End Sub

How do I get the macro to prompt the user to insert a text string that can
be used for the cross-reference?  Apologies if this is easy, I'm not familiar
with Word VBA yet.
Geoff.
Greg Maxey - 22 May 2006 13:54 GMT
Something like this:

Sub MarkGlossaryEntry()
Dim oText As String
oText = InputBox("Type a cross reference")
If Selection.Type = wdSelectionNormal Then
   ActiveDocument.Indexes.MarkEntry Range:=Selection.Range, _
       Entry:=Selection.Range.Text, CrossReference:=oText,
Italic:=False
End If
End Sub
 
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.