Formatting Bookmarks

  • Thread starter Thread starter PRatcliff
  • Start date Start date
P

PRatcliff

Hello,

I have a Word 97 template with bookmarks into which I insert data from
a t-sql query coming from a SQL database. The problme I am having is
that the data (text only) always appears in the document with the
first letter in upper case and the rest of the word in lower case. The
autocorrect Capitalize First Letter is off. Does anyone have an idea
of how I can format this text? Is there a way to format bookmarks?
I've tried to select the areas around the bookmark and format that
area but it does not work.

I would be happy to use a VBA macro but cannot figure out how to
trigger the macro as the data isn't in the document to format on open
(autoNew, autoOpen) and the document will be edited manually prior to
printing.

*ack* any help greatly appreciated.
P Ratcliff
 
Might be easier to format the data as part of the SQL statement. Depends on
the DB engine you're using; this will work with some DBs:

SELECT lcase(MyField) as xMyField ....

then use xMyField as the value inserted into the document.
 
Thanks for the info - sorry, but I should have said I've already tried
this. It doesn't matter what I do in the SQL statement, the results
are always Sentence Case. Any more ideas would be greatly appreciated.

Cheers
PRatcliff
 
Never mind. I figured out a way to make it work. I'm using a time
delay -

Sub autoNew()
Application.OnTime when:=Now + TimeValue("00:00:03"),
Name:="bookmarkUpdate"
End Sub

in case someone else wants to do this. bookmarkUpdate is a simple
script that changes the case of text in a range.

Also, the reason the text ALWAYS went in as Sentence Case is that the
programmer (for reasons best know to himself) formatted the query
results in the application code to Sentence Case - leaving me no
option but to format after the fact. Arg!

Anyway, thanks much for the help and time.
P Ratcliff
 
Back
Top