469,572 Members | 1,674 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,572 developers. It's quick & easy.

Making Text bold in Word with VBA

Hello all,
I have made a form with a lot of entryfields and one button which, when
clicked on, transforms all of the entryfields values into a MS Word
document.
All the formatting is done programatically and all works well, except for
one thing:
I don't seem to be able to make a paragraph apear in bold.
I have tried: Selection.Font.Bold = wdToggle ' does not work
I have tried: Selection.Font.Weight = 700 ' does not work
I have tried: Selection.TextEffect.Fontbold = true ' does not work

Can anybody help ? this would be very much appreciated ....
Thanks.

Ronny Sigo
Nov 12 '05 #1
6 26517
Ronny,

Are you sure your paragraph is really selected?
Check with something like:
If Selection.Start = Selection.End Then msgbox "No selection"

--
Hope this helps
Arno R
"Ronny sigo" <ro*********@toegrefnet7.be> schreef in bericht
news:3f**********************@feed0.news.be.easyne t.net...
Hello all,
I have made a form with a lot of entryfields and one button which, when
clicked on, transforms all of the entryfields values into a MS Word
document.
All the formatting is done programatically and all works well, except for
one thing:
I don't seem to be able to make a paragraph apear in bold.
I have tried: Selection.Font.Bold = wdToggle ' does not work
I have tried: Selection.Font.Weight = 700 ' does not work
I have tried: Selection.TextEffect.Fontbold = true ' does not work

Can anybody help ? this would be very much appreciated ....
Thanks.

Ronny Sigo



Nov 12 '05 #2
Thanks for responding Arno,
I think something is selected allright, not only did I insert this below
instruction to check this, I also replaced this stuborn command with
Selection..Font.Size = 32 and it works. It just puts the text that I want to
size 32
only Selection.Font.Bold = wdToggle does not work.
The font used is Arial 10
Any suggestions ?
Thanks
"Arno R" <ar****************@tiscali.nl> schreef in bericht
news:3f**********************@dreader2.news.tiscal i.nl...
Ronny,

Are you sure your paragraph is really selected?
Check with something like:
If Selection.Start = Selection.End Then msgbox "No selection"

--
Hope this helps
Arno R
"Ronny sigo" <ro*********@toegrefnet7.be> schreef in bericht
news:3f**********************@feed0.news.be.easyne t.net...
Hello all,
I have made a form with a lot of entryfields and one button which, when
clicked on, transforms all of the entryfields values into a MS Word
document.
All the formatting is done programatically and all works well, except for one thing:
I don't seem to be able to make a paragraph apear in bold.
I have tried: Selection.Font.Bold = wdToggle ' does not work
I have tried: Selection.Font.Weight = 700 ' does not work
I have tried: Selection.TextEffect.Fontbold = true ' does not work

Can anybody help ? this would be very much appreciated ....
Thanks.

Ronny Sigo


Nov 12 '05 #3
I have pinched the properties of the fields named CtlDetail (assuming it is
a report)

With Selection.Font
.Name = CtlDetail.Properties("FontName")
.Size = CtlDetail.Properties("FontSize")
.Bold = CtlDetail.Properties("FontBold")
.Italic = CtlDetail.Properties("FontItalic")
.Underline = CtlDetail.Properties("FontUnderline")
etc etc
End With

Phil
"Ronny sigo" <ro*********@toegrefnet7.be> wrote in message
news:3f**********************@feed0.news.be.easyne t.net...
Hello all,
I have made a form with a lot of entryfields and one button which, when
clicked on, transforms all of the entryfields values into a MS Word
document.
All the formatting is done programatically and all works well, except for
one thing:
I don't seem to be able to make a paragraph apear in bold.
I have tried: Selection.Font.Bold = wdToggle ' does not work
I have tried: Selection.Font.Weight = 700 ' does not work
I have tried: Selection.TextEffect.Fontbold = true ' does not work

Can anybody help ? this would be very much appreciated ....
Thanks.

Ronny Sigo

Nov 12 '05 #4
Thanks Phil,
I am affraid I don't understand your reply ... I am not speaking of a report
here. I use a normal MS Access form of which I use the values in the
textboxes in my Word document.
All commands work except this wdToggle ; just to put one line in bold.
I can't be so hard to do, I simply don't understand why it does not work,
while all the other commands do work ....
I think I need or : a simple instruction (unknown to me at present)
or: an explanation of what you are trying to tell me
with the CtlDetail thing

Thanks

Ronny Sigo
"Phil Stanton" <ph**@stantonfamily.co.uk> schreef in bericht
news:3f*********************@mercury.nildram.net.. .
I have pinched the properties of the fields named CtlDetail (assuming it is a report)

With Selection.Font
.Name = CtlDetail.Properties("FontName")
.Size = CtlDetail.Properties("FontSize")
.Bold = CtlDetail.Properties("FontBold")
.Italic = CtlDetail.Properties("FontItalic")
.Underline = CtlDetail.Properties("FontUnderline")
etc etc
End With

Phil
"Ronny sigo" <ro*********@toegrefnet7.be> wrote in message
news:3f**********************@feed0.news.be.easyne t.net...
Hello all,
I have made a form with a lot of entryfields and one button which, when
clicked on, transforms all of the entryfields values into a MS Word
document.
All the formatting is done programatically and all works well, except for one thing:
I don't seem to be able to make a paragraph apear in bold.
I have tried: Selection.Font.Bold = wdToggle ' does not work
I have tried: Selection.Font.Weight = 700 ' does not work
I have tried: Selection.TextEffect.Fontbold = true ' does not work

Can anybody help ? this would be very much appreciated ....
Thanks.

Ronny Sigo


Nov 12 '05 #5
Try Selection.Font.Bold = True

Phil

"Ronny sigo" <ro*********@toegrefnet7.be> wrote in message
news:3f**********************@feed0.news.be.easyne t.net...
Thanks Phil,
I am affraid I don't understand your reply ... I am not speaking of a report here. I use a normal MS Access form of which I use the values in the
textboxes in my Word document.
All commands work except this wdToggle ; just to put one line in bold.
I can't be so hard to do, I simply don't understand why it does not work,
while all the other commands do work ....
I think I need or : a simple instruction (unknown to me at present)
or: an explanation of what you are trying to tell me
with the CtlDetail thing

Thanks

Ronny Sigo
"Phil Stanton" <ph**@stantonfamily.co.uk> schreef in bericht
news:3f*********************@mercury.nildram.net.. .
I have pinched the properties of the fields named CtlDetail (assuming it

is
a report)

With Selection.Font
.Name = CtlDetail.Properties("FontName")
.Size = CtlDetail.Properties("FontSize")
.Bold = CtlDetail.Properties("FontBold")
.Italic = CtlDetail.Properties("FontItalic")
.Underline = CtlDetail.Properties("FontUnderline")
etc etc
End With

Phil
"Ronny sigo" <ro*********@toegrefnet7.be> wrote in message
news:3f**********************@feed0.news.be.easyne t.net...
Hello all,
I have made a form with a lot of entryfields and one button which, when clicked on, transforms all of the entryfields values into a MS Word
document.
All the formatting is done programatically and all works well, except for one thing:
I don't seem to be able to make a paragraph apear in bold.
I have tried: Selection.Font.Bold = wdToggle ' does not work
I have tried: Selection.Font.Weight = 700 ' does not work
I have tried: Selection.TextEffect.Fontbold = true ' does not work

Can anybody help ? this would be very much appreciated ....
Thanks.

Ronny Sigo



Nov 12 '05 #6
Thanks Phil,
This works. I was stupid enough to see Font.Bold as FontBold (without the
dot in between Font and Bold)
Greetings :)

Ronny sigo
"Phil Stanton" <ph**@stantonfamily.co.uk> schreef in bericht
news:3f*********************@mercury.nildram.net.. .
Try Selection.Font.Bold = True

Phil

"Ronny sigo" <ro*********@toegrefnet7.be> wrote in message
news:3f**********************@feed0.news.be.easyne t.net...
Thanks Phil,
I am affraid I don't understand your reply ... I am not speaking of a

report
here. I use a normal MS Access form of which I use the values in the
textboxes in my Word document.
All commands work except this wdToggle ; just to put one line in bold.
I can't be so hard to do, I simply don't understand why it does not work,
while all the other commands do work ....
I think I need or : a simple instruction (unknown to me at present)
or: an explanation of what you are trying to tell me with the CtlDetail thing

Thanks

Ronny Sigo
"Phil Stanton" <ph**@stantonfamily.co.uk> schreef in bericht
news:3f*********************@mercury.nildram.net.. .
I have pinched the properties of the fields named CtlDetail (assuming
it is
a report)

With Selection.Font
.Name = CtlDetail.Properties("FontName")
.Size = CtlDetail.Properties("FontSize")
.Bold = CtlDetail.Properties("FontBold")
.Italic = CtlDetail.Properties("FontItalic")
.Underline = CtlDetail.Properties("FontUnderline")
etc etc
End With

Phil
"Ronny sigo" <ro*********@toegrefnet7.be> wrote in message
news:3f**********************@feed0.news.be.easyne t.net...
> Hello all,
> I have made a form with a lot of entryfields and one button which, when > clicked on, transforms all of the entryfields values into a MS Word
> document.
> All the formatting is done programatically and all works well,

except for
> one thing:
> I don't seem to be able to make a paragraph apear in bold.
> I have tried: Selection.Font.Bold = wdToggle ' does not work
> I have tried: Selection.Font.Weight = 700 ' does not work
> I have tried: Selection.TextEffect.Fontbold = true ' does not work
>
> Can anybody help ? this would be very much appreciated ....
> Thanks.
>
> Ronny Sigo
>
>



Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by ingvald | last post: by
2 posts views Thread by Imaya Kumar | last post: by
1 post views Thread by Piotrek Stachowicz | last post: by
6 posts views Thread by Flyzone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.