Real newb question.

L

Luke

How do you determine if an object has been set or not?
I mean I attempt to set a Range for instance like this:

Set myRange = aRange.Next(wdCharacter, 1)

How do I determine if myRange actually got set? Since if
I'm at the end of a document the Next() method doesn't
return anything?

Thanks again, for the help,
Luke
 
C

Charles Maxson

You can use IF and Is Nothing to test if an object is set to something:

If Not myRange Is Nothing Then
// It exists!
Else
// It DOES NOT exist!
End if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top