Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

I was given this macro from this group

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steved - 04 Feb 2005 05:24 GMT
Hello from Steved

The below macro Keeps highlighting the belowand will not
work please help.

pWords = Split(Range.Text, " ")

Sub Testing()
Dim pWords() As String
pWords = Split(Range.Text, " ")
For i = 0 To UBound(pWords)
   If pWords(i) Like "[a-zA-Z]{1,}" Then
       pStartWord = i
       Exit For
   End If
Next

Output = pWords(pStartWord)
For i = pStartWord + 1 To UBound(pWords)
   Output = Output & " " & pWords(i)
Next
End Sub
Jezebel - 04 Feb 2005 05:47 GMT
By now you should have learned enough about coding to actually read and
think about these code snippets. You can't just paste them into a module and
pray.

a) Insert, in place of Range.Text, whatever string you're working with.

b) Declare all the variables.

> Hello from Steved
>
[quoted text clipped - 18 lines]
> Next
> End Sub
Steved - 04 Feb 2005 06:15 GMT
Hello from Steved

I am very new at this and have no idea about the
terminology and subsequently i've now have no idea
what to do with your kind answer. Please understand
the reason I came to this sight is to get an answerto my
issue, and the end result would be that it works. You are
asking me to understand code which is new to me so please
if you would bare with me please just show me how I can
get your macro to function. In other words a) and b)I
cannot comprehend.

Thankyou.

>-----Original Message-----
>By now you should have learned enough about coding to actually read and
[quoted text clipped - 29 lines]
>
>.
Jezebel - 04 Feb 2005 07:00 GMT
The code is working on a piece of text. I don't know where the text is
coming from, so you'll need to put that in yourself. Presumably it's the
text of a paragraph ... but you can't expect the forum to write your entire
app for you. This is basic stuff well covered in help.

You declare variables with Dim statements. This too is very basic and well
explained in help as well as at the beginning of chapter 1 of any
programming guide you care to look at.

Trying to learn to program by trial and error is truly the slowest possible
way to go about it.

> Hello from Steved
>
[quoted text clipped - 50 lines]
>>
>>.
Chuck - 04 Feb 2005 15:29 GMT
Hi Steve

Please see my response in your other thread (Subject: A bit of A challenge
for me to do.).  See this message:  
http://communities2.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=m
icrosoft.public.word.vba.general&mid=a177dd1b-2af3-4417-8445-e4327414e1d2&sloc=e
n-us


As Jezebel said in her response in this thread, a lot of information has
been provided for you to work with in figuring out for yourself how to make
her suggestions work in your particular circumstances.

An alternative might be offer to hire a developer to provide you with custom
code.

Chuck

> Hello from Steved
>
[quoted text clipped - 18 lines]
> Next
> End Sub
Steved - 04 Feb 2005 21:00 GMT
Thankyou both for your input to my issue.

This is a once only project hence because I wanted a
complete macro that I could use (not to understand the
mechanics of the macro) i've decided on another way to
acheive my objective.

Once again thankyou.

>-----Original Message-----
>Hi Steve
>
>Please see my response in your other thread (Subject: A bit of A challenge
>for me to do.).  See this message:  
>http://communities2.microsoft.com/communities/newsgroups/en-us/default.aspx?
dg=microsoft.public.word.vba.general&mid=a177dd1b-2af3-
4417-8445-e4327414e1d2&sloc=en-us

>As Jezebel said in her response in this thread, a lot of information has
>been provided for you to work with in figuring out for yourself how to make
[quoted text clipped - 29 lines]
>>
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.