custom button on tool bar

F

farooq

i recorded a macro...simple. i start at a line in a 250 page document. what i want to do is clear all tab stops line by line...(because i hate doing it myself line by line). so i recorded the macro. used arrow key to jump down to next line. then went to Format Tabs...selected Clear All, close and stop macro. this was named Macro1. but what i want to do is create a button on a toolbar...so i can just click it, and it will run this macro. and thus, i will keep running it til the end of the document. someone help me please?
 
C

Charles Kenyon

Ctrl-A (select all)
Format => Tabs => Clear All (button)

Then, if you still need to attach something to a button on a toolbar...
Tools => Customize => Commands
Scroll down to macros in the window on the left, find your macro in the
window on the right and drag it to a toolbar.
--

Charles Kenyon

See the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

farooq said:
i recorded a macro...simple. i start at a line in a 250 page document.
what i want to do is clear all tab stops line by line...(because i hate
doing it myself line by line). so i recorded the macro. used arrow key to
jump down to next line. then went to Format Tabs...selected Clear All,
close and stop macro. this was named Macro1. but what i want to do is
create a button on a toolbar...so i can just click it, and it will run this
macro. and thus, i will keep running it til the end of the document.
someone help me please?
 
J

Jay Freedman

Hi, farooq,

You found probably the two hardest possible ways of clearing tabs. :) Try
this instead:

Select a group of lines where you want to clear all the tabs (or select the
entire document with Ctrl+A if you want to clear all the tabs everywhere).
Then go to Format > Tabs and click Clear All. That will clear all the manual
tab stops in the entire selection with one click!

To answer the original question, the procedure for creating a toolbar button
is at http://word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToToolbar.htm.
 
J

Jean-Guy Marcil

Hi farooq,

If all you want to do is clear all the tab stops in the document in one go,
use this instead:

ActiveDocument.Content.Paragraphs.TabStops.ClearAll

Otherwise, to add your macros to the toolbar,:
Tools > Customize...
In the Customize dialog:
Commands tab,
On the left, select Macros,
On the right, find your macro,
Then, drag it to the toolbar of your choice to create a button.
The button will bear the macro's full name, something like
"TemplateProject.NewMacros.Macro1", if you want to change that, immediately
after creating the button, right click on it and in the submenu that
appears, change its name.
Close the dialog box.

--
Cheers!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org


farooq said:
i recorded a macro...simple. i start at a line in a 250 page document.
what i want to do is clear all tab stops line by line...(because i hate
doing it myself line by line). so i recorded the macro. used arrow key to
jump down to next line. then went to Format Tabs...selected Clear All,
close and stop macro. this was named Macro1. but what i want to do is
create a button on a toolbar...so i can just click it, and it will run this
macro. and thus, i will keep running it til the end of the document.
someone help me please?
 

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