Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   Help With Passing Bold Formatting Through String Into Word (http://www.go4expert.com/forums/help-passing-bold-formatting-string-word-t15977/)

IcePirates 28Jan2009 20:28

Help With Passing Bold Formatting Through String Into Word
 
Hello,

My question is VBA/Excel related...

I have an excel sheet, in that excel sheet is a command button, once clicked the command button creates a Word document.

Im trying to get my VBA script to bold certain text that will be in the word document. But all my attempts to bold certain cell contents have failed.
Im not getting any errors from the editor, its just not bolding certain text Ive told it too when the word document gets created.

I have included an attachment (And Ive tried the following methods already)

1. ActiveCell.Font.Bold & "This Is Function One, This Text Will Appear Bold" & wks.Cells(ActiveCell.Row, 2) & _

2. "This is Function Two, This Text Will Appear Bold" & wks.Cells(ActiveCell.Row, 2).Font.Bold

3. "This is Function Three, This Text Will Appear Bold" & wks.Cells(ActiveCell.Row, 2) & (ActiveCell.Font.Bold) & _

shabbir 28Jan2009 20:36

Re: Help With Passing Bold Formatting Through String Into Word
 
Please try explaining in post rather than attaching the complete problem.

IcePirates 28Jan2009 20:43

Re: Help With Passing Bold Formatting Through String Into Word
 
The issue arrises, when a user clicks on the command button inside the .xls to create the word document...Whats happening is, Im trying to tell certain lines to bold when the word document gets created, such as: (in the Excel sheet, Module 1, you will find)

"Sale File #: " & wks.Cells(ActiveCell.Row, 9) & vbNewLine & _

I change that to something like
"Sale File #: " & wks.Cells(ActiveCell.Row, 9) & (ActiveCell.Row.Font.Bold) & vbNewLine & _


Thereby when the macro is excuted inside the .xls sheet it should make the text "Sale File #" bold in the word document...

However - Im not getting any errors when changing the VBA, the problem arrises when the Word Document gets created, because the particular text I want bold, is not bolding in the word document...

Does that make a bit more sense?
Let me know if it doesn't, I can explain some more.


All times are GMT +5.5. The time now is 10:38.