Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
[email protected] gailbaker@hotmail.com is offline
external usenet poster
 
Posts: 1
Default Formatting the Index in a Word doc using VB

I am using VB script to open a word document and populate it with
stuff from an Access Database.
I have an Index at the back of the document. Everything is working
fine except The Word "Index" shows up on one page and the index shows
up on another. If I try to move the word INDEX down the index also
moves down.
Here's my code for the Heading "Index" and for the index part. I guess
I'm wondering how to get the heading "Index" to be just aove the
actual index without the space in between.

Sub CreateIndex()
Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
Selection.Style = ActiveDocument.Styles("heading 1")
Selection.Font.Size = 14
Selection.TypeText Text:="INDEX"
Selection.Font.Size = 14
Selection.TypeParagraph
*****It's here that
the heading stops and the index begins*********
With ActiveDocument.Styles("Index 1").Font
.Name = "Times New Roman"
.Size = 11
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.ColorIndex = wdAuto
.Engrave = False
.Superscript = False
.Subscript = False
.Scaling = 100
.Kerning = 0
.Animation = wdAnimationNone
End With
Selection.Style = ActiveDocument.Styles("Index 1")
With ActiveDocument
.Indexes.Add Range:=Selection.Range, HeadingSeparator:= _
wdHeadingSeparatorNone, RightAlignPageNumbers:= _
True, NumberOfColumns:=1, AccentedLetters:=False
.Indexes(1).TabLeader = wdTabLeaderDots

End With
End Sub

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Index / TOC formatting galatea2153 Microsoft Word Help 2 June 26th 07 12:58 AM
Index field formatting Ian Richardson ACITP Microsoft Word Help 4 May 22nd 07 11:48 AM
how do i correct formatting in an index Gayle Microsoft Word Help 1 February 10th 07 06:32 PM
Index formatting Shana Microsoft Word Help 1 September 25th 06 01:45 AM
Formatting the font of an index RuthAnn Microsoft Word Help 1 July 11th 06 10:20 PM


All times are GMT +1. The time now is 03:07 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"