Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word VBA

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 06-28-2012, 02:47 AM
tinfanide tinfanide is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2011
Posts: 308
tinfanide is on a distinguished road
Default Check which ListGalleries a list belongs to?


If I have two lists,
the first one is wdNumberGallery and
the second one is wdBulletGallery.
How could I check in Word VBA which type they belong to?
Reply With Quote
  #2  
Old 06-28-2012, 05:20 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 16,353
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

If:
Quote:
the first one is wdNumberGallery and
the second one is wdBulletGallery
surely you already know which type they belong to??
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 06-29-2012, 12:38 AM
tinfanide tinfanide is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2011
Posts: 308
tinfanide is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
If:

surely you already know which type they belong to??
But how? Can't use Range.Information
Reply With Quote
  #4  
Old 06-29-2012, 12:51 AM
tinfanide tinfanide is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2011
Posts: 308
tinfanide is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
If:

surely you already know which type they belong to??
Sorry... asking too soon. I'd forgotten ListType.

Code:
Dim oList As List
For Each oList In ActiveDocument.Lists
    If oList.Range.ListFormat.ListType = wdListSimpleNumbering Then ''' wdListSimpleNumbering / 3
          oList.Range.Select
    End If
Next oList
Reply With Quote
  #5  
Old 06-29-2012, 12:55 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 16,353
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

I was about to post:
Code:
Sub Test()
MsgBox Selection.Paragraphs(1).Range.ListFormat.ListType
End Sub
but maybe now I won't ...
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #6  
Old 06-29-2012, 07:47 AM
tinfanide tinfanide is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2011
Posts: 308
tinfanide is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
I was about to post:
Code:
Sub Test()
MsgBox Selection.Paragraphs(1).Range.ListFormat.ListType
End Sub
but maybe now I won't ...
Anyway, thanks for your replay, though.
Reply With Quote
Reply
Please reply to this thread with any new information or opinions.

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Link word check box to access check box Mrkieth Word 4 01-30-2012 06:43 AM
VBA: How to control Word ListGalleries in Excel? tinfanide Excel Programming 0 12-12-2011 03:56 AM
How to select all paragraphs that belongs to certain "Style" but doesn't take its for Jamal NUMAN Word 6 09-21-2011 12:09 PM
How do you create a list similar to an itunes list? hatemail13 Excel 1 08-06-2010 02:21 AM
Need Help with Using a Check Box Nick9589 Excel 1 05-01-2010 09:29 AM


All times are GMT -7. The time now is 02:33 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft