473,323 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

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 27301
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ingvald | last post by:
hi, i've hit a wall regarding php and ms word. what i want is to open a document containing bookmarks, insert text where the bookmarks are, and save. it's working, unless the bookmark is in...
2
by: Imaya Kumar | last post by:
Hi, i'm developing an editor in VS.NET using Rich Text Box Control. I need to make a selected text Bold. how can i do this? also i will have an Italic Button too. If i click Bold button the...
1
by: Piotrek Stachowicz | last post by:
Hi, Does anyone know if there is any way to display text in ToolTip as bold or italic? If so, how?! Piotrek
1
by: ahmad | last post by:
I want to make a particular option's text bold within a list in html, while all other options will get their normal font-weight, How can i do this???????? i tried <b>, <font> tags and style and...
2
by: Rex | last post by:
Hi, I want to make a particular piece of text BOLD (during runtime) in a textbox. for example: consider a string "The next stage for plaque collection will be at the end of January". I want to...
1
by: ganesh22 | last post by:
Hi, Iam getting the below error while my application is running on IIS. in my application iam converting a text into word format, so i added some .dll from COM for converting word format ...
6
by: Flyzone | last post by:
Hello, i'm trying to paste copied text from word into an input box. This text is saved into a oracle db and then used as text in another javascript. The problem is that using the saved text...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.