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 / October 2006

Tip: Looking for answers? Try searching our database.

Check last character

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin R - 23 Oct 2006 03:41 GMT
I have a docvariable - { DOCVARIABLE "EELName" } - that pulls an employees
last name from a user form.  I need to be able to check the last character of
that name to see if it is an "s" or not.  If so, then I will need to add just
an apostrophe.  If it is not an "s" then I will need to add an apostrophe
followed by s, ex: 's.  Any ideas?
Greg Maxey - 23 Oct 2006 04:14 GMT
I am assuming that you are checking the last character of the docVariable
value.  Something like this:
Sub Test()
Dim strName As String
ActiveDocument.Variables("EElName").Value = "Miller" 'added for testing
strName = ActiveDocument.Variables("EElName").Value
If Right(strName, 1) = "s" Then
 strName = strName & "'"
Else
 strName = strName & "'s"
End If
MsgBox strName
End Sub

You could just as easily check the Userform textbox for this condition and
make the change before writing its result to the docvariable.

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> I have a docvariable - { DOCVARIABLE "EELName" } - that pulls an
> employees last name from a user form.  I need to be able to check the
> last character of that name to see if it is an "s" or not.  If so,
> then I will need to add just an apostrophe.  If it is not an "s" then
> I will need to add an apostrophe followed by s, ex: 's.  Any ideas?
Kevin R - 23 Oct 2006 04:22 GMT
How do I check the userform textbox beforehand?  That would be even better.  
Thanks!

> I am assuming that you are checking the last character of the docVariable
> value.  Something like this:
[quoted text clipped - 18 lines]
> > then I will need to add just an apostrophe.  If it is not an "s" then
> > I will need to add an apostrophe followed by s, ex: 's.  Any ideas?
Russ - 23 Oct 2006 05:42 GMT
Kevin,

> How do I check the userform textbox beforehand?  That would be even better.
You test it with the same type of 'If...Else...End If' clause that Greg
showed, but in the appropriate click event subroutine in your userform. You
may want to keep the original unchanged name in one variable and within the
aforementioned clause create another variable for the possessive version of
the name to put in the docVariable you mentioned.
> Thanks!
>
[quoted text clipped - 20 lines]
>>> then I will need to add just an apostrophe.  If it is not an "s" then
>>> I will need to add an apostrophe followed by s, ex: 's.  Any ideas?

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

Jezebel - 23 Oct 2006 05:03 GMT
Greg has given you the gist of the method. But I query the correctness. The
possessive of Jones is Jones's not Jones'

>I have a docvariable - { DOCVARIABLE "EELName" } - that pulls an employees
> last name from a user form.  I need to be able to check the last character
[quoted text clipped - 3 lines]
> an apostrophe.  If it is not an "s" then I will need to add an apostrophe
> followed by s, ex: 's.  Any ideas?
Russ - 23 Oct 2006 05:21 GMT
I was taught to do this way, which I pulled from a grammar page on the web.
--------------------------------------
Singular possessive
The possessive form of a singular noun is an apostrophe followed by the
letter "s."

Kramer's hair
Daphne's patience
the car's engine

Words ending with s, z or x generally omit the "s."

Dr. Seuss' sense of humor
---------------------------------------
> Greg has given you the gist of the method. But I query the correctness. The
> possessive of Jones is Jones's not Jones'
[quoted text clipped - 6 lines]
>> an apostrophe.  If it is not an "s" then I will need to add an apostrophe
>> followed by s, ex: 's.  Any ideas?

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

Jezebel - 23 Oct 2006 06:37 GMT
I'd been interested in your source: Google throws up a heap of blogs and
tutorials on this topic, very few of which -- and none of the authorititave
ones -- agree with you. Even the execrable Strunk and White prefer 's for
possessives of words ending in s. Perhaps you're confusing the issue with
the possessive of plurals (where s' is indeed correct)?

>I was taught to do this way, which I pulled from a grammar page on the web.
> --------------------------------------
[quoted text clipped - 24 lines]
>>> apostrophe
>>> followed by s, ex: 's.  Any ideas?
Russ - 23 Oct 2006 09:56 GMT
Jezebel,
Here's the source I quoted:
http://www.meredith.edu/grammar/plural.htm#Singular%20p

"For proper names that end in s, style guides differ. Newspaper style guides
advocate adding only an apostrophe (Socrates' thoughts), while some standard
grammar guides state that all names other than those of biblical or
classical derivation require the addition of 's (thus, Socrates' thoughts,
Moses' footsteps, Orson Welles's films)."
That was quoted from:
http://www.editpros.com/news1101.html

> I'd been interested in your source: Google throws up a heap of blogs and
> tutorials on this topic, very few of which -- and none of the authorititave
[quoted text clipped - 30 lines]
>>>> apostrophe
>>>> followed by s, ex: 's.  Any ideas?

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

Jezebel - 23 Oct 2006 11:34 GMT
Rather confirms my point than yours, I think.

For what it's worth, you'll also find a heap of sites and blogs on the 'the
way I was taught' syndrome.)

> Jezebel,
> Here's the source I quoted:
[quoted text clipped - 47 lines]
>>>>> apostrophe
>>>>> followed by s, ex: 's.  Any ideas?
doctorjones_md - 28 Oct 2006 21:36 GMT
Russ,

I tend to agree with Jezebel on her interpretation of the rules (listed at
the site you offered) -- unless you're dealing with some biblical persona,
the Jones's example holds true -- I've used it all my life!  ;)

HTH end the volley of opinions ;)
==========================
> Rather confirms my point than yours, I think.
>
[quoted text clipped - 56 lines]
>>>>>> apostrophe
>>>>>> followed by s, ex: 's.  Any ideas?
Russ - 29 Oct 2006 04:06 GMT
Yes, I have seen enough to change my usage to the more formal style. It
stuck in my mind because I went to a Catholic school and had a Religion
class every year taught by the Nuns. :-(
Therefore, I became too familiar with seeing the biblical persona usage and
didn't think there was a distinction.

P.S. Speaking of biblical persona, Jezebel might not be Jezebel's real name
or implied sex.

> Russ,
>
[quoted text clipped - 64 lines]
>>>>>>> apostrophe
>>>>>>> followed by s, ex: 's.  Any ideas?

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

 
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.