Macros

D

David

I am still having problems. In Word 2003 I create a Macro, in bold and
it is different each day. When I create it, for some reason it changes
to plain type every other time but I need it bold every time.I was told
to edit the Macro to keep it bold every time I use it and I can now do
that. However, each day I have to do the same thing. How do I keep this
as a default setting so each day the settings are the same and it will
come out bold each time. Thank you. David
 
H

Helmut Weber

Hi,

the only thing I can think about,
would be

With Selection.Font
.Bold = Not .Bold
End With

used once every other day.

:)

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
C

Charles Kenyon

Hello David,

I think you've posted this before and been answered before.

The bold button on the formatting toolbar is a toggle button. When you
record it, you record the toggle operation. It changes whatever the bold
setting is to its opposite.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
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.
 
T

Tony Jollans

This rings a bell - I think I answered you before and you replied something
to the effect that you were recording a macro every day to insert the date
and that every time you did it you had to go and edit the (new) macro - to
which I may not have replied further - if so, my apologies.

The thing to do - if I have remembered correctly - is, rather than typing
the date, use Insert > Date from the Menu (and record yourself doing it).
You should then have a macro (which you might need to change once for the
bolding) which should then work every day without the need for re-recording.

Come back if that doesn't help.
 
D

David

Sadly, this does not help. What I need is the date in bold every time.
Using Insert/date is fine but it still comes out bold every second time
I use it. I am sorry to be such a dunce but I guess I am more of a
novice than I thought!
 
T

Tony Jollans

Record the macro to insert the date in bold once (by using Insert > Date).
In the recorded code, change the setting of Bold to True

That should be all you need to do. The macro will then always insert the
current date in bold.
 
D

Doug Robbins - Word MVP

The following will insert the date at the location of the selection in the
format indicated, apply bold formatting to it, then insert a space after the
date and turn off the bold formatting as I assume that you do not want the
following text that is enterded to have that formatting:

Dim myrange As Range
Set myrange = Selection.Range
myrange.Text = Format(Date, "dd MMMM yyyy")
myrange.Font.Bold = True
myrange.Collapse wdCollapseEnd
myrange.Text = " "
myrange.Font.Bold = False
myrange.Collapse wdCollapseEnd
myrange.Select


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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