table/numbering/format problem

S

Sharon

I have created a macro (with code shown below) that prompts me for a prefix
letter A, B, C (or whatever you want to put) and then a prompt that asks
which number to begin the numbering with. I usually use this macro in a
table format. It has always worked out great until now. For some reason
when I run the macro, there is a line after the value, i.e., C1____, C2______

It has always confused me that when you do the automatic numbering it also
always puts a tab after the number even if I put all the settings to 0. Can
someone tell me what I am doing wrong? Thanks.



Sub IDSNumbering()
'
' IDSNumbergin Macro
' Macro recorded November 28, 2006 by Sharon Hart
'
With ListGalleries(wdNumberGallery).ListTemplates(1).ListLevels(1)
.NumberFormat = "%1"
.TrailingCharacter = False
.NumberStyle = wdListNumberStyleArabic
.NumberPosition = InchesToPoints(0)
.Alignment = wdListLevelAlignLeft
.TextPosition = InchesToPoints(0)
.TabPosition = InchesToPoints(0)
.ResetOnHigher = 0
.StartAt = 1
With .Font
.Bold = False
.Italic = False
.StrikeThrough = False
.Subscript = False
.Superscript = False
.Shadow = False
.Outline = False
.Emboss = False
.Engrave = False
.AllCaps = False
.Hidden = False
.Underline = wdUnderlineNone
.Color = wdColorBlack
.Size = 10
.Animation = wdUndefined
.DoubleStrikeThrough = False
.Name = "Times New Roman"
End With
.LinkedStyle = ""
End With
ListGalleries(wdNumberGallery).ListTemplates(1).Name = ""
Selection.Range.ListFormat.ApplyListTemplate
ListTemplate:=ListGalleries( _
wdNumberGallery).ListTemplates(1), ContinuePreviousList:=True,
ApplyTo:= _
wdListApplyToWholeList, DefaultListBehavior:=wdWord10ListBehavior

Dim Message2, Title2, Default2, MyPrefix
Message2 = "Enter a Prefix" ' Set prompt.
Title2 = "Prefix" ' Set title.
Default2 = "A" ' Set default.

' Display message, title, and default value.
MyPrefix = InputBox(Message2, Title2, Default2)

Dim Message, Title, Default, MyValue
Message = "Enter a value" ' Set prompt.
Title = "Reference Number" ' Set title.
Default = "1" ' Set default.

' Display message, title, and default value.
MyValue = InputBox(Message, Title, Default)



With ListGalleries(wdNumberGallery).ListTemplates(6).ListLevels(1)
.NumberFormat = MyPrefix & "%1"
.TrailingCharacter = wdTrailingTab
.NumberStyle = wdListNumberStyleArabic
.NumberPosition = InchesToPoints(0.5)
.Alignment = wdListLevelAlignLeft
.TextPosition = InchesToPoints(0.5)
.TabPosition = InchesToPoints(0.5)
.ResetOnHigher = 0
.StartAt = MyValue

With .Font
.Bold = wdUndefined
.Italic = wdUndefined
.StrikeThrough = wdUndefined
.Subscript = wdUndefined
.Superscript = wdUndefined
.Shadow = wdUndefined
.Outline = wdUndefined
.Emboss = wdUndefined
.Engrave = wdUndefined
.AllCaps = wdUndefined
.Hidden = wdUndefined
.Underline = wdUndefined
.Color = wdUndefined
.Size = wdUndefined
.Animation = wdUndefined
.DoubleStrikeThrough = wdUndefined
.Name = ""
End With
.LinkedStyle = ""
End With
ListGalleries(wdNumberGallery).ListTemplates(6).Name = ""
Selection.Range.ListFormat.ApplyListTemplate
ListTemplate:=ListGalleries( _
wdNumberGallery).ListTemplates(6), ContinuePreviousList:=False,
ApplyTo:= _
wdListApplyToWholeList, DefaultListBehavior:=wdWord10ListBehavior
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top