add text to the active page

S

sianarun

Hi,
I am writing a macro to automatically add some shapes and texts to a page.
Does anyone know what command I can use to write a text?
What is a good reference for finding the answer of such simple questions?
I am using visio 2003 ,but for some reason I cannot search the development
reference. It's so frustrating to find every single command online. Any
suggestions is greatly appreciated.

Thanks,
 
S

sianarun

Hi Al,

Thank you very much for the quick response. That was a very helpful link. I
still could not find the appropriate command to put a text box in the drawing
page. All I need to do is to put an "x" letter at a specific coordination
with a specific font. I really appreciate it if you could help me with that.
How do you add such a text box?

Sia
 
N

Nikolay Belyh

Hi Al,

Thank you very much for the quick response. That was a very helpful link. I
still could not find the appropriate command to put a text box in the drawing
page. All I need to do is to put an "x" letter at a specific coordination
with a specific font. I really appreciate it if you could help me with that.
How do you add such a text box?

Use macro recorder. It rocks.
Tools -> Macro -> Start Recording...
Start recording, drop the text manualy, do whatever you want with it -
Stop recording
Done, you have the code generated for you.

Kind regards, Nikolay.
 
S

sianarun

Thanks for the quick response. The thing is that I don't want to put anything
there manually. Everything should be done in a macro.
 
A

AlEdlund

The reason that Niolay suggested the macro recorder, is it will catch the
necessary code for you as a macro so that you can examine what the solution
might look like.
al
 
S

sianarun

Thanks for the quick response. The thing is that I don't want anything to be
done manually. So I need to put the x letter through the macro. Any
suggestion is appreciated.
 
N

Nikolay Belyh

Thanks for the quick response. The thing is that I don't want anything to be
done manually. So I need to put the x letter through the macro. Any
suggestion is appreciated.

OK then.
If you insist you don't want the rod, here is the fish:

Set shp = Application.ActiveWindow.Page.DrawRectangle(1, 1, 3, 2)
shp.TextStyle = "Normal"
shp.LineStyle = "Text Only"
shp.FillStyle = "Text Only"
shp.Text = "X"
shp.CellsSRC(visSectionCharacter, 0, visCharacterSize).FormulaU =
"14 pt"

Kind regards, Nikolay
 

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