Solved

How to create bulleted list in word document using VB

Posted on 2004-08-13
5
594 Views
Last Modified: 2008-03-06
Hi All,

I want to create a bulleted list in word document using VBA Code. Can anybody help me out?

Regards,
Deepak
0
Comment
Question by:deepak_khopade
  • 2
5 Comments
 
LVL 8

Accepted Solution

by:
SNilsson earned 500 total points
ID: 11790849
First you need to select where your list should start, can be done with a bookmark for example.

Then you need choose how many rows down you need to be bulleted.

Selection.MoveDown Unit:=wdLine, Count:=3, Extend:=wdExtend
(Count:=3 will select 3 rows as an example)

Then you need to apply the bullets:
Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=ListGalleries(wdBulletGallery).ListTemplates(1), ContinuePreviousList:=False, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:=wdWord9ListBehavior

(Beware of wordwrap above it's supposed to be on one line)


To remove the bullets from a selection you can use this:
Selection.Range.ListFormat.RemoveNumbers NumberType:=wdNumberParagraph


If you need to bullet everything do this befor applying the bullet list:
Selection.WholeStory
0
 

Author Comment

by:deepak_khopade
ID: 11829212
thanx yaar.

it works fine for me.
0
 
LVL 8

Expert Comment

by:SNilsson
ID: 11829579

Good to hear, how about an 'accept answer' then :)
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
word0 challenge 4 68
wordmultiple challenge 12 131
Scripting vs. Programming languages 25 165
Change the background and font colors in Notepad++ 5 78
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now