How to

A

AZ

How to do this using Range object (programmatically)?

Selection.Range.Case = wdTitleWord

I tried Range.Case = wdTitleWord, it does not work, the
program can apply other formattings (i.e. alignment;
Range.Alignment = Alignment) on this (Range) object.

regards
 
A

AZ

My apologies, I made a mistake of messing up with Word97 &
above. The program uses Word97 and the system has got
word2000.

regards

-----Original Message-----
Thanks Mark,

The program selects a bookmark within the template, this
BM is of type enclosed one ([]). Using
Selection.Range.Case = wdTitleWord does not work
programmatically, however by selecting this BM (Ctrl-G,
Goto BookMark) in the document opened in word and
clicking 'Format', 'Change Case' it works fine. Am I
missing something?

regards


-----Original Message-----
AZ,

Range.Case doesn't by itself indicate a range object.
You have to assign one -- that is, assign an object
variable equal to a range. For example this will cap
all of the words in the document's third paragraph:

Dim r As Range
Set r = ActiveDocument.Paragraphs(3).Range
r.Case = wdTitleWord

--
Mark Tangard <[email protected]>, Microsoft Word MVP
Please reply only to the newsgroup, not by private email.
Note well: MVPs do not work for Microsoft.
"Life is nothing if you're not obsessed." --John Waters

.
.
 
M

Mark Tangard

AZ,

It should work the same in either version. I'm pretty sure
bookmark-related VBA didn't change.

In any case, next time you have a VBA problem -- or if this
one isn't solved yet -- paste the relevant portion of your
code into the body of your post. It's much easier than
describing it and much easier for us to spot what's wrong.

--
Mark Tangard <[email protected]>, Microsoft Word MVP
Please reply only to the newsgroup, not by private email.
Note well: MVPs do not work for Microsoft.
"Life is nothing if you're not obsessed." --John Waters

My apologies, I made a mistake of messing up with Word97 &
above. The program uses Word97 and the system has got
word2000.

regards
-----Original Message-----
Thanks Mark,

The program selects a bookmark within the template, this
BM is of type enclosed one ([]). Using
Selection.Range.Case = wdTitleWord does not work
programmatically, however by selecting this BM (Ctrl-G,
Goto BookMark) in the document opened in word and
clicking 'Format', 'Change Case' it works fine. Am I
missing something?

regards


-----Original Message-----
AZ,

Range.Case doesn't by itself indicate a range object.
You have to assign one -- that is, assign an object
variable equal to a range. For example this will cap
all of the words in the document's third paragraph:

Dim r As Range
Set r = ActiveDocument.Paragraphs(3).Range
r.Case = wdTitleWord

--
Mark Tangard <[email protected]>, Microsoft Word MVP
Please reply only to the newsgroup, not by private email.
Note well: MVPs do not work for Microsoft.
"Life is nothing if you're not obsessed." --John Waters

AZ wrote:

How to do this using Range object (programmatically)?

Selection.Range.Case = wdTitleWord

I tried Range.Case = wdTitleWord, it does not work, the
program can apply other formattings (i.e. alignment;
Range.Alignment = Alignment) on this (Range) object.

regards
.
.
 

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