Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-21-2012, 06:48 AM
tinfanide tinfanide is offline VBA: How to debug.Print enumeration names? Windows 7 64bit VBA: How to debug.Print enumeration names? Office 2010 32bit
Expert
VBA: How to debug.Print enumeration names?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default VBA: How to debug.Print enumeration names?


Code:
Debug.Print (Selection.Type)
It just prints the value of the Selection Enumeration. I want something like "wdSelectionIP" instead of just "1".
Reply With Quote
  #2  
Old 01-26-2012, 01:56 PM
macropod's Avatar
macropod macropod is offline VBA: How to debug.Print enumeration names? Windows 7 64bit VBA: How to debug.Print enumeration names? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Hi tinfanide,

AFAIK, the numeric type is the best you'll get via Debug.Print. For anything fancier, you'd need to create a Select Case statement or something such with your own enumeration list to retrieve the names from the numbers and use a MsgBox instead of Debug.Print.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 01-27-2012, 12:39 AM
tinfanide tinfanide is offline VBA: How to debug.Print enumeration names? Windows 7 64bit VBA: How to debug.Print enumeration names? Office 2010 32bit
Expert
VBA: How to debug.Print enumeration names?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Hi tinfanide,

AFAIK, the numeric type is the best you'll get via Debug.Print. For anything fancier, you'd need to create a Select Case statement or something such with your own enumeration list to retrieve the names from the numbers and use a MsgBox instead of Debug.Print.
So for Microsoft developers, they're just reading enumeration (numeric types) for reference and check it up on the MSDN tables?
If I need the names, I needa manually populate a list?
Reply With Quote
  #4  
Old 01-27-2012, 01:31 AM
macropod's Avatar
macropod macropod is offline VBA: How to debug.Print enumeration names? Windows 7 64bit VBA: How to debug.Print enumeration names? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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 you're using late binding (eg when driving Word from Excel and you want compatability with Office versions older than what you're using), you have to use the numeric values. The text versions are only of any use for macros within Word or that use early binding.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 01-27-2012, 01:41 AM
tinfanide tinfanide is offline VBA: How to debug.Print enumeration names? Windows 7 64bit VBA: How to debug.Print enumeration names? Office 2010 32bit
Expert
VBA: How to debug.Print enumeration names?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Yes, your old thread told me so. It seems that my coming projects are only to be dependent on numeric values.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debug for macro run through button only when sheet protected leahca Excel Programming 0 11-24-2011 04:47 AM
VBA: How to debug.Print enumeration names? Equations - Enumeration and cross referencing hpon Word 5 12-27-2010 02:27 PM
Headers - Enumeration hpon Word 1 11-02-2010 10:50 AM
VBA: How to debug.Print enumeration names? Print preview and actual print do not match? anthrax19888 Word 1 10-12-2009 08:09 AM
Microsoft Office 2003 winword.exe Debug Error! abnormal prog elo1bev Word 0 12-22-2005 10:15 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:18 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