Formatting using macro

M

Mohan

Hi,
I am using macro to populate data in the publisher. I want to do formatting
of this data, say making Bold and using bullets. How can I do this? Is it
possible or not?

Thanks
Mohan
 
E

Ed Bennett

Mohan said:
I am using macro to populate data in the publisher. I want to do formatting
of this data, say making Bold and using bullets. How can I do this? Is it
possible or not?

I'm presuming you're using one of the TextRange.Insert() methods to
insert the text. (e.g. InsertAfter)

This method returns a text range, to which you can then apply formatting.

E.g.

Dim aTextRange As TextRange
Set aTextRange = _
ThisDocument.Pages(1).Shapes(1).TextFrame.TextRange.InsertAfter _
("Look, some blue text!!")
aTextRange.Font.Color.RGB = RGB(0, 0, 255)

or

ThisDocument.Pages(1).Shapes(1).TextFrame.TextRange.InsertAfter _
("Look, some blue text!!").Font.Color.RGB = RGB(0, 0, 255)
 

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