Group:  Microsoft Word ยป microsoft.public.word.vba.beginners
Thread: How to keep date from wrapping between month and day

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

How to keep date from wrapping between month and day
"David" <davids9307[ at ]aol.com> 30.09.2006 06:28:13
I have written a macro to allow the user to enter dates in mmddyy
format and then hit a hotkey to expand the dates into January 1, 2006
format. However, if the date is near the end of a line it can separate
the month from the day because of word wrap. I know that if I am
entering text from the keyboard, I can use control-shift-space to make
a "sticky space," but I can't get this to work in VBA. Currently the
line involved is:

If d$(1) + d$(2) = "01" Then mm$ = "January "

I think I would want to replace "January " with "January" + chr$(??),
but I can't find any reference to this.

Thanks in advance for any tips on how to do this.

David

Re: How to keep date from wrapping between month and day
Russ <drsN0SPAMmikle[ at ]hotmailD0Tcom.INVALID> 30.09.2006 08:08:04
David,
See some usage by clicking on this link for Google Groups search:
http://tinyurl.com/pe4pb

[Quoted Text]
> I have written a macro to allow the user to enter dates in mmddyy
> format and then hit a hotkey to expand the dates into January 1, 2006
> format. However, if the date is near the end of a line it can separate
> the month from the day because of word wrap. I know that if I am
> entering text from the keyboard, I can use control-shift-space to make
> a "sticky space," but I can't get this to work in VBA. Currently the
> line involved is:
>
> If d$(1) + d$(2) = "01" Then mm$ = "January "
>
> I think I would want to replace "January " with "January" + chr$(??),
> but I can't find any reference to this.
>
> Thanks in advance for any tips on how to do this.
>
> David
>

--
Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

Re: How to keep date from wrapping between month and day
"Graham Mayor" <gmayor[ at ]REMOVETHISmvps.org> 30.09.2006 09:39:07
It's a non breaking space you are looking for
"January" & Chr(160)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

David wrote:
[Quoted Text]
> I have written a macro to allow the user to enter dates in mmddyy
> format and then hit a hotkey to expand the dates into January 1, 2006
> format. However, if the date is near the end of a line it can separate
> the month from the day because of word wrap. I know that if I am
> entering text from the keyboard, I can use control-shift-space to make
> a "sticky space," but I can't get this to work in VBA. Currently the
> line involved is:
>
> If d$(1) + d$(2) = "01" Then mm$ = "January "
>
> I think I would want to replace "January " with "January" + chr$(??),
> but I can't find any reference to this.
>
> Thanks in advance for any tips on how to do this.
>
> David


Re: How to keep date from wrapping between month and day
"David" <davids9307[ at ]aol.com> 30.09.2006 16:01:52
Thanks for the replies. 160 is exactly what I was looking for. I see
now that the term "sticky space" is only the name on Mac. My coworkers
are going to be very, very happy.

Thanks again,

David


Graham Mayor wrote:
[Quoted Text]
> It's a non breaking space you are looking for
> "January" & Chr(160)
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
> David wrote:
> > I have written a macro to allow the user to enter dates in mmddyy
> > format and then hit a hotkey to expand the dates into January 1, 2006
> > format. However, if the date is near the end of a line it can separate
> > the month from the day because of word wrap. I know that if I am
> > entering text from the keyboard, I can use control-shift-space to make
> > a "sticky space," but I can't get this to work in VBA. Currently the
> > line involved is:
> >
> > If d$(1) + d$(2) = "01" Then mm$ = "January "
> >
> > I think I would want to replace "January " with "January" + chr$(??),
> > but I can't find any reference to this.
> >
> > Thanks in advance for any tips on how to do this.
> >
> > David

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net