Hello, I would like to know how to:
1) I'm creating a kind of interactive program, what I need to do is to
select each word of the document, then for each, select all the characters of
the word and then do something with each one of the characters and the go to
the next word, until now I have:

Sub dfd()
Dim oword, ochr As Range
Set oword = ActiveDocument.Words
For n = 1 To oword.Count
oword.Item(n).Select
Set ochr = oword.Item(n).Characters
For Each ochr In oword
'bla bla bla bla ba
Next
Next
End Sub

2) I would like to create a userform, when the userform is deactivated you
are able to correct whatever you want for your document without closing the
userform(like the find and replace form, you can change stuff on your
document without closing the form)

3) a usrform with 2 bottons, before and next, when the before button is
pressed it goes to the last word seleted (or changed) and with the next
button it goes to the next word that fill a spesific criteria.

Thanks for your help

Re: Multiple easy questions. by Helmut

Helmut
Fri Feb 22 06:23:25 PST 2008

Hi filo666,

at 1)
Sub Test555xxx()
Dim rWrd As Range
Dim rChr As Range
' incase of Dim rWrd, rChr As Range
' rWrd would be a variant !
For Each rWrd In ActiveDocument.Range.Words
For Each rChr In rWrd
' your code
Next
Next
End Sub


at 2)
You need a modeless userform, like:
UserForm1.Show vbModeless

at 3)
>a userform with 2 bottons, before and next, when the before button is
>pressed it goes to the last word seleted (or changed)
That is a bit more difficult
You might explore the predefined bookmarks
"\PrevSel1" and "\PrevSel2"

>and with the next button it goes to the next
>word that fill a spesific criteria.

Depends on the criteria.




--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP

Re: Multiple easy questions. by Jay

Jay
Fri Feb 22 06:21:53 PST 2008

I apologize in advance if I'm mistaken, but these look like homework questions.
If they are, please try to work them out yourself first. If you get stuck on a
particular point, ask a specific question about that point. You won't learn the
intended lessons if someone just hands you the solutions.

On Fri, 22 Feb 2008 05:12:00 -0800, filo666 <filo666@discussions.microsoft.com>
wrote:

>Hello, I would like to know how to:
>1) I'm creating a kind of interactive program, what I need to do is to
>select each word of the document, then for each, select all the characters of
>the word and then do something with each one of the characters and the go to
>the next word, until now I have:
>
>Sub dfd()
>Dim oword, ochr As Range
>Set oword = ActiveDocument.Words
>For n = 1 To oword.Count
>oword.Item(n).Select
>Set ochr = oword.Item(n).Characters
>For Each ochr In oword
>'bla bla bla bla ba
>Next
>Next
>End Sub
>
>2) I would like to create a userform, when the userform is deactivated you
>are able to correct whatever you want for your document without closing the
>userform(like the find and replace form, you can change stuff on your
>document without closing the form)
>
>3) a usrform with 2 bottons, before and next, when the before button is
>pressed it goes to the last word seleted (or changed) and with the next
>button it goes to the next word that fill a spesific criteria.
>
>Thanks for your help

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.

Re: Multiple easy questions. by Helmut

Helmut
Fri Feb 22 06:40:28 PST 2008

Hi Jay,

I wasn't aware of that.

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP

Re: Multiple easy questions. by filo666

filo666
Fri Feb 22 06:45:00 PST 2008

As always, you answered my questions, thank you very much, where did you
learn VB, it seems to me that you know everything!!!!
Kind greatings from Israel.

pd, I finished studing 6 years ago, 6 years with now homeworks.

"Helmut Weber" wrote:

> Hi filo666,
>
> at 1)
> Sub Test555xxx()
> Dim rWrd As Range
> Dim rChr As Range
> ' incase of Dim rWrd, rChr As Range
> ' rWrd would be a variant !
> For Each rWrd In ActiveDocument.Range.Words
> For Each rChr In rWrd
> ' your code
> Next
> Next
> End Sub
>
>
> at 2)
> You need a modeless userform, like:
> UserForm1.Show vbModeless
>
> at 3)
> >a userform with 2 bottons, before and next, when the before button is
> >pressed it goes to the last word seleted (or changed)
> That is a bit more difficult
> You might explore the predefined bookmarks
> "\PrevSel1" and "\PrevSel2"
>
> >and with the next button it goes to the next
> >word that fill a spesific criteria.
>
> Depends on the criteria.
>
>
>
>
> --
>
> Greetings from Bavaria, Germany
>
> Helmut Weber, MVP WordVBA
>
> Vista Small Business, Office XP
>

Re: Multiple easy questions. by Helmut

Helmut
Fri Feb 22 07:04:30 PST 2008

Hi Filo,

self educated, autodidact.

Have a nice day.

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP