ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Insert text in bold (https://www.excelbanter.com/excel-programming/354023-insert-text-bold.html)

rocket0612[_8_]

Insert text in bold
 

I am trying to insert bold text to word 97 using a macro from excel:

Wrd.ActiveDocument.Fields(10).Select
With Wrd.Selection
..Font.Bold = wdToggle
..InsertAfter Text:="HOW TO CONTACT US"
'.Font.Bold = wdToggle
End With

However, the text when inserted is not being bolded, any suggestions?


--
rocket0612
------------------------------------------------------------------------
rocket0612's Profile: http://www.excelforum.com/member.php...o&userid=19492
View this thread: http://www.excelforum.com/showthread...hreadid=515312


Tim Barlow

Insert text in bold
 
Rocket,

Don't toggle the bold (it can lead to confusion) - set it to true for the
selection after inserting the text (and don't miss out the leading
full-stops/periods) - e.g.

With Selection
.InsertAfter Text:="HOW TO CONTACT US"
.Font.Bold = True
End With

HTH

Tim


"rocket0612" wrote
in message ...

I am trying to insert bold text to word 97 using a macro from excel:

Wrd.ActiveDocument.Fields(10).Select
With Wrd.Selection
Font.Bold = wdToggle
InsertAfter Text:="HOW TO CONTACT US"
'.Font.Bold = wdToggle
End With

However, the text when inserted is not being bolded, any suggestions?


--
rocket0612
------------------------------------------------------------------------
rocket0612's Profile:

http://www.excelforum.com/member.php...o&userid=19492
View this thread: http://www.excelforum.com/showthread...hreadid=515312





All times are GMT +1. The time now is 08:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com