Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-28-2012, 02:47 AM
tinfanide tinfanide is offline Check which ListGalleries a list belongs to? Windows 7 64bit Check which ListGalleries a list belongs to? Office 2010 32bit
Expert
Check which ListGalleries a list belongs to?
 
Join Date: Aug 2011
Posts: 312
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 Check which ListGalleries a list belongs to? Windows 7 64bit Check which ListGalleries a list belongs to? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
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
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 06-29-2012, 12:38 AM
tinfanide tinfanide is offline Check which ListGalleries a list belongs to? Windows 7 64bit Check which ListGalleries a list belongs to? Office 2010 32bit
Expert
Check which ListGalleries a list belongs to?
 
Join Date: Aug 2011
Posts: 312
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 Check which ListGalleries a list belongs to? Windows 7 64bit Check which ListGalleries a list belongs to? Office 2010 32bit
Expert
Check which ListGalleries a list belongs to?
 
Join Date: Aug 2011
Posts: 312
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 Check which ListGalleries a list belongs to? Windows 7 64bit Check which ListGalleries a list belongs to? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
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
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 06-29-2012, 07:47 AM
tinfanide tinfanide is offline Check which ListGalleries a list belongs to? Windows 7 64bit Check which ListGalleries a list belongs to? Office 2010 32bit
Expert
Check which ListGalleries a list belongs to?
 
Join Date: Aug 2011
Posts: 312
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



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

Other Forums: Access Forums

All times are GMT -7. The time now is 04:08 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft