Visual Basics - programming case eg upper case/lower case

  • Thread starter Jane via OfficeKB.com
  • Start date
J

Jane via OfficeKB.com

Hi there,

Can anyone tell me how I programme my form in Visual Basics for the text to
appear as it is typed.

I have certain text that I want to appear as Upper Case eg

InsertBkMkText "Department", txtDepartment. Text, wdUpperCase

but I have other text that I need it to appear as it is typed eg

Orewa office or Hibiscus Coast Holiday Park

I don't know which command to type to make it work eg

InsertBkMkText "Location", txtLocation.Text, wd???

If I put the command wdTitleWord it will make the word 'office' appear as
'Office' or if I type it as wdSentence it will make the words 'Hibiscus Coast
Holiday Park' appear as 'Hibiscus coast holiday park' and if I just leave it
blank and don't put any wd commands in at all I get an error.

Hope this makes sense and look forward to hearing from anyone who can help.

Thanks a lot.

Jane.
 
D

debbieprobert via OfficeKB.com

Hi Jane

Presumably InsertBkMkText is a routine you have written and are passing
information to? If that is correct then try making the last parameter that
you need to receive an optional one. In this way, if you do not want to
specify a case you can leave it out.

For example:

Sub InsertBkMkText(strBkName as string, strInfilText as string, Optional
lngCase as Long)

When calling it:

InsertBkMkText "MyBookmark", "my bookmark text", wdUpperCase

or

InsertBkMkText "MyBookmark", "my bookmark text"

Alternatively, convert the case of the text before inserting it into the
document.

I hope I've understood your question correctly. Apologies if not.

ArchieD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top