Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

macros

Status
Not open for further replies.

sept2006

Technical User
Sep 6, 2006
42
CA
hello,

i need to create a macro in powerpoint to change font sizes.
would you mind to guide me. i never used macros or VB before.


thanks a lot.
 
Oh say!
but it did not give any result.

thanks
 

Not ANY results?

I just recorded a macro that selected a shape and change the font and I got over a dozen line of code.

Hmmmmmmm????

Skip,

[glasses] [red][/red]
[tongue]
 
sept2006,

To check and see if the macro recorded anything, you need to do this:

Tools Menu
--> Macros
----> Visual Basic Editor

And see if the code shows up there.
 
Thanks.
i did record a macro but it did not do what I wanted.

i highlighted a word, changed its font, color and size.

1. i need to know how to call this macro from the keyboard
2. when i called this macro a second time, it did the changes for another word and not the one I chose.
i see in the VB code that the range is fixed (Start:=147, Length:=10). I would like to do these changes whenever i need it.

here's the code that has been generated.

ActiveWindow.Selection.SlideRange.Shapes("Rectangle 3").Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=147, Length:=10).Select
ActiveWindow.Selection.TextRange.Font.Name = "Comic Sans MS"
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=147, Length:=10).Select
ActiveWindow.Selection.TextRange.Font.Size = 30
End Sub


thanks again
 
Hmm, I've not delved much into using code with Power Point, but I would think that you would need to change that specific reference to one something like:

ActiveShape or SelectedShape and/or Selection...
 
Hi
I haven't tested this but it is where I would start using your recorded code

With ActiveWindow.Selection.TextRange.font
.Name = "Comic Sans MS"
.Size = 30
end with


;-)
If a man says something and there are no women there to hear him, is he still wrong? [ponder]
How do I get the best answers?
 


sept2006 said:
i need to create a macro in powerpoint to change font sizes.

The advice I gave is correct and to the point of your question. Like TEACHING a man to fish, rather than GIVING a man a fish, my answer was designed to HELP you to DISCOVER the answer YOURSELF.

The fact that you first stated, "but it did not give any result", then stated, "i did record a macro but it did not do what I wanted" and finally, "i need to know how to call this macro from the keyboard" tells me that you are not focused.

You will get plenty of good help here at Tek-Tips if you state you questions CLEARLY, COMPLETELY and CONCISELY.

============================================

Now, please tell us EXACTLY what you are trying to accomplish with the macro. Please be CLEAR, COMPETE and CONCISE.

Skip,

[glasses] [red][/red]
[tongue]
 
Hi Skip,
This is exactly what happened!
I agree that i was not very clear.

I need to change the font size and type for a set of characters many times in a slide.

my question is: is there a way to create a macro (executed by typing ctrl + st ) to do these changes?

and i agree with you: i would prefer to learn how to use macros rather than get a solution that answers one question. the problem is that i never used macros before.
a tutorial would be much appreciated.

thanks again.

 



The best tutorial is the macro recorder.

It's focused on what you are trying to do.

"...for a set of characters ..."

What set? How is that defined? Is it by some sort of logic, or is it based on your selection?

Skip,

[glasses] [red][/red]
[tongue]
 
a selection that varies from slide to slide
thanks again
 




Then, your FORAMTTING is based on the Selection object.

I think that you'll have to run your macro on a User Defined Toolbar Button.

Skip,

[glasses] [red][/red]
[tongue]
 
could you shed some light on 'User Defined Toolbar Button'?
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top