Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Macro to Articulate & Reset MS Word List Bullets

Status
Not open for further replies.

RandySS

Technical User
Dec 7, 2009
20
US
REFERENCE thread222-1723548

Hi All-

Can you please advise how to use an Excel Selection Object to articulate a Word paragraph bullet from Excel. I'm told I'm trying to articulate via a Word Selection Object from Excel. Frankly, I don't know the difference. The particular piece of VBA that hangs in Excel VB is as follows:

[START]
Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
ListGalleries(wdNumberGallery).ListTemplates(1), ContinuePreviousList:= _
False, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:= _
wdWord10ListBehavior
[END]

The complete macro can be seen at thread222-1723548

Thank you very much for any insights you can offer!
 
Correction: In my opening sentence I should have asked:
"Can you please advise how to use a WORD Selection Object to articulate a Word paragraph bullet from Excel. I'm told I'm presently trying to articulate via an EXCEL Selection Object from Excel, which is preventing my macro from running correctly."

Sorry for confusion.
Thx!
 
[!][highlight #FCE94F]With WordApp[/highlight][/!]
[!][highlight #FCE94F].[/highlight][/!]Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
[!][highlight #FCE94F].[/highlight][/!]ListGalleries(wdNumberGallery).ListTemplates(1), ContinuePreviousList:= _
False, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:= _
wdWord10ListBehavior
[highlight #FCE94F][!]End With[/highlight][highlight #FCE94F][/highlight][/!]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PVH,
Yes, I've tried that, but it didn't change anything. Problem still continues. Returns error message:
"Run-time error '450': Wrong number of arguments, or invalid property assignment."
Thanks for engaging!
 
I'm not sure that you have, I'm afraid. I may be mistaken, but from your original thread in the VB6 forum and this thread here it seems pretty clear that your are tapping in code without understanding it, perhaps because our advice was unclear (I know mine was designed to simply point you in the right direction, rather than provide cookie-cutter code). Might I suggest that, before proceeding further, you read up on th With keyword in Office help. It should help clarify a few things, and demonstrate that

Selection

and

.Selection

are importantly different
 
Of course, it would also be better to work with Word Ranges rather than Word Selections...

Cheers
Paul Edstein
[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top