PDA

View Full Version : Validating a certain "Text"...



Psyclops
10-10-2006, 11:11 PM
Hi Anyone,

I need help to:


Validate a specific "Text" or "String"
ex."MyName" if it exists and if does verify if
its font size is equal to 16 using Macro....

mdmackillop
10-11-2006, 12:40 AM
Hi Psyclops.
Use the macro recorder to create a macro for the Find routine. Add in the previous code I gave you for font name, but using font size instead of name. You could then add an InputBox to allow flexible searching. Check VBA Help for use on Find and Inputbox, but if you need assistance, let us know.

fumei
10-11-2006, 04:49 AM
Hi Malcolm...uh.....love the added suggestion line!

Hmmm, yes.........

Psyclops, Malcolm is right. You need to be actually trying to do stuff. Help for VBA is actually quite decent, and is your friend.

Psyclops
10-11-2006, 11:43 PM
Malcom and Gerry,

Thanks...for the suggestions it's indeed a great help....

Psyclops

najam_ftp
10-12-2006, 02:46 AM
Sub fin_0n_basis_prop()
Dim i As Integer
Dim str As String
Dim si As Integer
str = InputBox("Enter the string you want to find.........")
si = CInt(InputBox("check for font size????"))
Selection.HomeKey Unit:=wdStory
With Selection.Find
Do While (.Execute(findtext:=str, Forward:=True) = True) = True
If Selection.Range.Font.size <> si Then
Selection.Range.HighlightColorIndex = wdBlue
End If
Loop
End With
End Sub

now u have got them selected do what u wish, if want to access indivdual store these ranges in array

fumei
10-13-2006, 07:31 AM
Just out of curiosity..... could you explain the use of:

Sub fin_0n_basis_prop()

as a Sub name??????