Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-30-2012, 09:55 AM
gmaxey gmaxey is offline Is there no wdOrange colorindex variable? Windows 7 32bit Is there no wdOrange colorindex variable? Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Jennifer,



wdOrange is a Long variable not a wdColorIndex:

Code:
Sub MyRandCharColors()
Dim oChr As Range
Dim sngRan As Single
Dim lngColorNext As Long
Dim wdOrange As Long
Dim varColors
wdOrange = 41215
varColors = Array(wdGreen, wdOrange, wdBlue)
Randomize
For Each oChr In Selection.Characters
  sngRan = Rnd()
  lngColorNext = varColors(Int((UBound(varColors) + 1) * sngRan))
  On Error Resume Next
  oChr.Font.ColorIndex = lngColorNext
  If Err.Number <> 0 Then
    oChr.Font.Color = lngColorNext
  End If
Next oChr
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there no wdOrange colorindex variable? Run-time error '91': Object variable or With block variable not set tinfanide Excel Programming 2 06-10-2012 10:17 AM
Is there no wdOrange colorindex variable? variable Page references scrinmemphis Word 4 06-06-2012 11:50 PM
Is there no wdOrange colorindex variable? Capture a Font in a Variable joatmon Excel Programming 1 05-30-2012 08:23 PM
Help with VBA macro - Variable input sc30317 Excel Programming 0 08-31-2011 01:00 PM
Variable fields? Emalee77 PowerPoint 0 01-30-2011 05:58 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:29 PM.


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