Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Bold Letters In Word


How can I make certain text in Bold. I have a form that sends data to bookmarks in this form bookmark (such and such).text= "Name: " + userform1.textbox1.text

I would like "Name: " to be in bold and userform1.textbox1.text to be in regular text.


THANKS
MS WORD
VBA




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Bold Letters In RTB
I am trying to make only certain characters in a Rich text Box bold, so far all i can do is make all the letters or none of the letter bold when i write the text.
Here is what i am using:

Code:
Dim x As Integer
For x = 1 To Len(Text1.Text)
RichTextBox1.Text = RichTextBox1.Text & Mid(Text1.Text, x, 1)
RichTextBox1.SelStart = Len(RichTextBox1.Text) - 1
RichTextBox1.SelLength = 1
RichTextBox1.SelBold = True
RichTextBox1.Text = RichTextBox1.Text & Mid(Text1.Text, x, 1)
Next x
In this example, I am trying to write the text in textbox1 into richtextbox1, but i want to have one bold and one non-bold letter from textbox1 to be written.

Printing Bold Letters?
hai everybody,
i am trying to write a program which will send the text directly to the printer for the printing purpose. my code is like this
Open "LPT1" For Output As #1
Print #1, "hello : user1"
Close #1

i am opening the lpt1 and sending the string to that port. But my problem is i want to do the formatting for the text which i am sending to the printer. I mean, in the above string i want to print "hello" in the normal font and the "user1" in bold format.
How to do that? please help me.
Thanks to all
varma

Printing Bold Letters
Hai
I am using the following print command in my application.

dim p as long
p=freefile
open "LPT1:" for output as p
print #p, "This is line 1"
priint #p, text1.text & " is the content of textbox"
close p

This works fine.But i want to print some characters or some lines
alone in different font size and also bold.How can i accomplish this
Help urgently needed.


regards
senthil

How Would The Program Know If A Text Is Written In Bold Letters?
if in the textbox there is a word "HELLO HI" and the word "HI" is in bold letters, is there a possibility that when i use the Mid$ function and split the two words, the program would know that the word "HI" is in bold letters and the word "HELLO" is NOT in bold letters?

How To Change The Fontstyle Of Single Word To Bold In Word Doc?
Hi Everybody !

Can anyone please help me change the font style of few words in a sentence to BOLD while generating a word document as output? Currently I am using the code as below & If I use .bold command it makes whole of the document as bold which i do not want.
Here is my code:

Private Sub comletter()
Dim oDoc As Word.Document
Dim oRange As Word.Range
Dim sTemp As String
'Show Word to the user
oWord.Visible = False

'Add a new, blank document
Set oDoc = oWord.Documents.Add

' Format Pagesetup'
With ActiveDocument.PageSetup
'.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.TopMargin = InchesToPoints(2.5)
.BottomMargin = InchesToPoints(0.75)
.LeftMargin = InchesToPoints(0.75)
.RightMargin = InchesToPoints(0.75)
.Gutter = InchesToPoints(0)
'.HeaderDistance = InchesToPoints(0.5)
'.FooterDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(8.23)
.PageHeight = InchesToPoints(11.69)
'.FirstPageTray = wdPrinterDefaultBin
'.OtherPagesTray = wdPrinterDefaultBin
'.SectionStart = wdSectionNewPage
'.OddAndEvenPagesHeaderFooter = False
'.DifferentFirstPageHeaderFooter = False
'.VerticalAlignment = wdAlignVerticalCenter
'.SuppressEndnotes = False
'.MirrorMargins = False
End With

'Get the current document's range object
Set oRange = oDoc.Paragraphs(1).Range
sTemp = vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & "Dated: " & Date
sTemp = sTemp & vbNewLine
sTemp = sTemp & vbNewLine

sTemp = sTemp & "Letter No." & "Dated: "
sTemp = sTemp & vbNewLine
sTemp = sTemp & vbNewLine
sTemp = sTemp & "sent on: "
sTemp = sTemp & vbNewLine

Set oRange = Nothing

oDoc.Paragraphs.Add

Set oRange = oDoc.Paragraphs(2).Range

oRange.ParagraphFormat.Alignment = wdAlignParagraphJustifyLow
sTemp = sTemp & vbNewLine
sTemp = sTemp & vbNewLine
sTemp = sTemp & vbTab & "This is to state that a letter has been posted on the above-mentioned address and that the date of the letter has been recorded in the Register on the ..........."
sTemp = sTemp & vbNewLine
sTemp = sTemp & vbNewLine
sTemp = sTemp & vbTab & "The payment of fee is required to be made within 3 months from the aforesaid date of recordal."
sTemp = sTemp & vbNewLine
sTemp = sTemp & vbNewLine
sTemp = sTemp & vbTab & "The Copy of Letter is enclosed and the receipt of the same may please be acknowledged"
sTemp = sTemp & vbNewLine
sTemp = sTemp & vbNewLine
sTemp = sTemp & vbNewLine
sTemp = sTemp & vbNewLine
sTemp = sTemp & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & " ( )"
sTemp = sTemp & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & vbTab & " Kamal Singh"
sTemp = sTemp & vbNewLine
sTemp = sTemp & vbNewLine
sTemp = sTemp & "To:"
sTemp = sTemp & vbNewLine
sTemp = sTemp & vbNewLine
oRange.Text = sTemp
sTemp = " " & vbCrLf

oWord.ActiveDocument.SaveAs "C:lettersample.doc"

End Sub

Word BOLD Problem
I have a report and at present my text is all font size 12 and Arial. However, for each section of my report I have a summary that is all capital letters.

This is my problem, I want the capitals to be in bold and underlined. Is it possible to search through all the text and any string of text which is two caracters or more, which is in capitals, to change these to be bold and underlined.

Can anyone help?

Any thoughts would be appreciated.

How To Bold Just One Word In A String
Format(StartTime, "hh:mm:ss") & " End Time: " & gblEndTime

The line above is for a caption for a text field. How can I bold End Time: but not bold the variable gblEndTime?

Bold A Sentence In Word From VBA Access
I am trying to bold a sentence in Word97 from within Access97. I have the following code........


Code:
MyRange.Find.Execute "ZZFirmNameZZ"
MyRange.Words.Last = CheckForNullSTR(rsEmailDetails!fs_firmname)
MyRange.Words.Last.Bold = True
The problem with this is if the field fs_firmname is more than one word it will only bold the first word ? How can i ensure that ALL the words will be bold ?

thanks

Setting Objects As Bold In Word
I have made my program in VB6 and am exporting information from a rtf box on my form. The box is not visible as it collects the data from the form and should then be transferred to a word doc.

I want to get certain parts of the text into bold, this shows up in the RTF box but when it is exported to Word this doesn't happen.

If you need anymore information feel free to ask, help would be appreciated.

Make Text Bold In Word
hello,
i'm inserting some text into word from visual basic. i use the following code:


Code:
MyWordApp.ActiveDocument.Bookmarks("Equipment").Range.InsertAfter Text:=lstItemsOrdered.List(i)

this works fine. i want to know if there is anyway to make this text bold.

thanks for the help

cheers

Find Text Then Bold It Via VB6 And Word
I'm trying to programmatically make a phrase bold and underlined within a Word document text that I generate from a VB6 app. Ideally I'd like to do this right as the text is added to the document, but I don't think there's a way to do this since the text I insert comes from the database (I do wonder if it can be done when I'm hardcoding text that goes into a Word document from VB6, this can also be useful to me).

At any rate, once text is inserted into Word from the database, I go to a bookmark, then I'm try to find the first instance of a specific phrase after the bookmark and make it bold & underlined. Is there a way to do this? Here's my snippet that didn't work:


Code:
WordDoc.Bookmarks("blah_blah").Select
With WordDoc.Bookmarks("blah_blah").Range.Find
.Text = "blah"
.Replacement.Text = "blah"
With .Replacement.Text
.Bold = True
.Underline = True
End With
End With

Thanks

~Laz

Bold Icon In The Word Toolbar
Hi, all.
I was wondering how I could change the bold icon to the bold "pressed" icon, meaning what happens when the bold icon gets changed to the "having-been-pressed" bold icon. You know what I mean, when you press an icon, it becomes "pressed" and then when you push it again it becomes "depressed." My question is, how can I get the bold icon to change to its variation icon? What command do I do?

Chris

WORD AUTOMATION & BOLD TEXT
You will mock me for years!.. but I could not set a row of a word table in BOLD style!! I have to turn a bi-dimensional array in a word table... and when I met the "§B§" string in a cell, set that row to BOLD.

rTot: Number of rows of the array.
cTot: Number of columns of the array.
Wtab: Word table
mycell: string
matrix: bi-dimensional array of strings

------------------------------------------------------------------------

For R = 1 To rTot
RowBold = False
For c = 1 To cTot
mycell = CStr(Matrix(R, C))
If InStr(mycell, "§B§") <> 0 Then
mycell = Left(mycell, Len(mycell) - 3)
RowBold = True
End If
Wtab.cell(R, c).Range.Text = mycell
If IsNumeric(mycell) Then Wtab.cell(R, c).Range.ParagraphFormat.Alignment = 2
Next
If RowBold = True Then
Wtab.Rows.item(R).Range.Font.Bold = True
End If
Next

-------------------------------------------------------

The Wtab.Rows.item(R).Range.Font.Bold = True statement should work... Or, at least, this is what I read in several forums...
HELP!!!

Word Automation &amp; Bold Text [HELP!]
You will mock me for years!.. but I could not set a row of a word table in BOLD style!! I have to turn a bi-dimensional array in a word table... and when I met the "§B§" string in a cell, set that row to BOLD.

rTot: Number of rows of the array.
cTot: Number of columns of the array.
Wtab: Word table
mycell: string
matrix: bi-dimensional array of strings

------------------------------------------------------------------------

For R = 1 To rTot
RowBold = False
For c = 1 To cTot
mycell = CStr(Matrix(R, C))
If InStr(mycell, "§B§") <> 0 Then
mycell = Left(mycell, Len(mycell) - 3)
RowBold = True
End If
Wtab.cell(R, c).Range.Text = mycell
If IsNumeric(mycell) Then Wtab.cell(R, c).Range.ParagraphFormat.Alignment = 2
Next
If RowBold = True Then
Wtab.Rows.item(R).Range.Font.Bold = True
End If
Next

-------------------------------------------------------

The Wtab.Rows.item(R).Range.Font.Bold = True statement should work... Or, at least, this is what I read in several forums...
HELP!!!

How To Make Last Word In Textbox Bold?
Let's say, whenever the user clicks a command button, it'll make the last word in text1 bold. How do I go about doing this? I think I use the sellength code or sumthin.. but I'm not to sure, which is why I'm asking

Make A Bold Checking In Word Document
Hi, can somebody pls tell me what I'm doing wrong here. I am getting a object error with the line

If wr.font.bold = true then.

i have inserted a bookmark named "First" and i need to check whether that the user has selected it and put it Bold. I know i'm doing some syntax declaration wrong but I am a newbie and I know know how to fix. Can someone pls help. I am attaching the whole document as well but i dont know whether attaching a .doc is valid attachment. Pls help

Private Sub cmdBold_Click()
Dim wr As Range
With ActiveDocument.Bookmarks
.Add Range:=Selection.range, Name:="First"
If wr.Font.Bold = True Then
MsgBox "True"
End If
End With

'Me.Hide
'UserForm2.Show vbModeless

End Sub

Recolor / Bold A Select Word In Text Box
I am working on my own IDE for a programming language called Lua (mainly used for video game mods (I use it a lot)), and I need to figure out how to do syntax highlighting.
I've seen a lot of things with Replace$ and whatnot, but I don't know that much about VB6 (the package I'm using for this).
Basically, I need to color select words blue, and make them bold.

Say I need to recolor the word "function", how would I go about doing that.
I would want it to be in real time, not line by line basis like VB6 does. Meaning that as soon as I finish the word, the new settings would take effect.

Word Automation - How To Insert Text And Set To Bold?
I'm dynamically creating Word docs in my VB6 app.
I'm using Word 2002 (v10).
In most cases I find and replace a marker field [keyName] in the template with some content from my app.
This works fine and allows the user to set the style of the text by setting the marker field (it's replaced in the same style).

I now have a piece of content that needs to be formatted by the code.
Basically I'd like:

Header 1
Para
Header 2
Para
Para
Para
Header 3
Para
Para


I've tried setting the Font to Bold but it doesn't work as I anticipate
In fact I get this!

Header 1
Para
Header 2
Para
Para
Para
Header 3

Para
Para


Here's the code:

Code:
    With WordApp
        ' Find the insertion point
        With .Selection.Find
            .Forward = True
            .ClearFormatting
            .MatchWholeWord = True
            .MatchCase = False
            .Wrap = wdFindContinue
            .Text = insertAfter ' The marker in the template
            found = .Execute
        End With
        If Not found Then Exit Sub

        With .Selection
            ' Collapse the selection and move to the end
            .Collapse wdCollapseEnd
            
            ' Get the data...
            Dim com As ADODB.Command
            Set com = New ADODB.Command
            With com
                .ActiveConnection = MDImain.db.cnn
                .CommandType = adCmdStoredProc
                .CommandText = "qryQuoteOptionSectionsDetails " & optionID & ", " & quoteID
                Set rsSections = .Execute
            End With
            
            optionTotal = 0
            Do While Not rsSections.EOF
                
                ' Section description should be highlighted
                fieldValue = rsSections!description & vbCr

                .Font.Bold = True
                .insertAfter fieldValue

                ' Reset font
                .Font.Bold = False
                
                ' Get more data...this should not be bold
                fieldValue = "<more data with carriage returns>"
                .insertAfter fieldValue & vbCr
                
                rsSections.MoveNext
            Loop
            
            rsSections.Close
            
        End With
    End With

I've tried everything I can think of but I'm just guessing now!
Any ideas!?

Mac

Edited by - AbbydonKrafts on 10/15/2006 3:02:39 PM

Finding Word With Given Letters
I want to check a database for words that consist of exaxtly those letters I type in a textbox. So if I type 'onil' I want to find 'lion' and 'loin' in the database, which contains existing words. If I have to cut up the string and explicitly try every combination it would become complex. It seems to me there should be a predefined function for this. Right?

Counting Letters In Word?
does any1 know how to find out the number of characters in a string?
i think its the len() function but i dont really know how to use it.
can any1 help?

Randomize Letters Within A Word
I'm trying to write a program that would take a sentence and randomize all the letters within each word except for the first and last letter. So for example the sentence:

There is a big house that was built on the lake

could become

Terhe is a big hosue taht was bulit on the lkae

Cutting Word Into Letters
Hey,

Lemme tell you what I'm trying to do...
Lets say there's a word...
bag
As an example ^

How can I cut this word into letters? I want to be able to use the same (sub)program for all words. Maybe I can specify the order in which it will determine.
1q
2w
3e
4r
5t
6y
7
8i
numbers being which letter it is in word and variable being the thing that represents that letter...
btw I just wrote the variable bottom-left of its number on the keyboard.


If anyone knows what Im talking about or has a question or something...Im frequently checking this forum for 1-2 hours or so...
Help please!!!
Thankss

Help!!-Counting Letters In A Word
Hello..i am making a program that counts letters in a program and displays letter using Left Right and InStr functions... however.. how can I make a command button to tell the user how many letters there are in a word after inputting the word into an input box?

I have read that the MID function is required to find this out. please help!~

1.

Dim W As String
Dim L As String
Dim a() As String

W = InputBox("input word")
L = InputBox("input letter")
a = Split(LCase(W), LCase(L))
MsgBox W & vbCrLf & L & vbCrLf & UBound(a)

2.

Dim NumberOfJs As String
Dim strText As String

Private Sub fsd_Click()
NumberOfJs = InputBox("input letter!", "Inputting the LEtter")
NumberOfJs = Len(strText) - Len(Replace(strText, NumberOfJs, ""))
MsgBox NumberOfJs

3.

Dim W As String
Dim L As String
Dim i As Integer
Dim Counts As Integer

W = InputBox("Input a word")
L = InputBox("Input a Letter")

Counts = 0 ' not really needed
For i = 1 To Len(W)
If LCase(Mid(W, i, 1)) = LCase(L) Then Counts = Counts + 1
Next i
MsgBox "There are " & Format(Counts) & " " & L & "'s in " & W
End Sub

Split Word Up Into Letters
hey all,

Anyone know how i can split a word/s typed in a text box up into letters?

thanks

b

MS Word - Using Forms For Letters
Dear experts,

I am using Word 2003 and need to create a letter of quotation. The information for the quotation is compiled in Excel spreadsheet. How do I link both files together for the purpose below:

Using the Drop down list (eg. for Type of Package), user can select Package A or Package B). Based on this selection, word can automatically extract the information from the Package Description column in Excel and put it in a table (in column Package Description)?

It's something like "If type of package = package A, then select description for package A".

We have many packages, and they all have different prices. If I can do this, then I can just maintain the Excel spreadsheet whenever there is a price revision, then Word can automatically update from source file.

Please help!

How Can I Count Letters In Word?
Hi,

I have a word that is in a text box. I also have a seperate command button and a label. I want to be able to click the button and for the number of letters in the word to appear in the label.

Any info on how I can do this.

Thanks

Mark

How Do I Make A Portion Of Text In Word Cell Bold?
I've created a word template with a table in it.

In one cell I am entering multiple lines. I'd like the first line (the name) to be bold.

I'm using asp and cannot figure out the correct property to call.

Here is part of the source code:


Code:
Set objWord = CreateObject("Word.Application") ' Create a Word object.
Set WordDoc = objWord.Documents.Add("C:Incident.dot") ' Start a document.
objWord.Application.Visible = False

With WordDoc
Open recordset here

Code:
Do While Not rsPeopleList.EOF
.Tables(7).Cell(row, col).Range.InsertAfter (rsPeopleList("LastName") & ", " & rsPeopleList("FirstName") & " " & rsPeopleList("MiddleName"))
.Tables(7).Cell(row, col).Range.InsertAfter (vbcrlf & vbcrlf)
If rsPeopleList("EmployeeRole") = "" Then
.Tables(7).Cell(row, col).Range.InsertAfter (vbcrlf)
Else
.Tables(7).Cell(row, col).Range.InsertAfter (rsPeopleList("EmployeeRole") & vbcrlf)
End If
.Tables(7).Cell(row, col).Range.InsertAfter ("Employee Number:" & vbTab)
If rsPeopleList("EmployeeID")="" Then
.Tables(7).Cell(row, col).Range.InsertAfter (vbcrlf)
Else
.Tables(7).Cell(row, col).Range.InsertAfter (rsPeopleList("EmployeeID") & vbcrlf)
End If
...

Thanks,

Julie

MSWORD Making One Word Bold In A Table Cell.
Hi

I am creating a report in word using tables in VB6.



One of the cells contains a surname and then two foren
ames for married
partners. I need to have the surname in bold and the
forenames as
normal.

When I do this I can make the whole cell bold or n
ormal. Can anybody
help?

Regards

Peter



Important Note: This E-Mail is confidential, it must not
be read,
copied, disclosed or used by any person other than the
above
named addressees. Unauthorised use, disclosure or copying is

strictly prohibited and may be unlawful. Eurostar (U.K.) L
imited
and Eurostar Group Limited disclaim any liability for any
action
taken in reliance on the content of this E-Mail. The c
omments
or statements expressed in this E-Mail are not necessarily
those
of Eurostar (U.K.) Limited, Eurostar Group Limited or any
subsidiaries or affiliates of either company.
Eurostar (U.K.) Ltd. Registered Office: Eurostar House, Wate
rloo
Station, London, SE1 8SE, Registered in England No. 246200
1
VAT No. GB 657 719 590
Eurostar Group Ltd. Registered office: Eurostar House, Water
loo
Station, London, SE1 8SE, Registered in England No. 379464
2
VAT No. GB 739 974 173

This email has been scanned for all viruses by the Mes
sageLabs Email
Security System on behalf of Eurostar. For more informatio
n on a proactive email security service working around t
he clock, around the globe, visit http://www.messagelabs.com

Change Font Bold Of A Cell In A Table In Word From VB
I've used some code from johnwm in thread222-589129 some time ago to help me make the table.  From that I've figured out how to change the "header row" background color.  Now I'm trying to change the "header row" font to bold but I'm having diffieculty.  Can someone help.  Here is the how I change the color of row 1 for each column.

CODE'This will change the color of the header row in the table
    With MyRange.Tables.ITEM(1)
    
        For g = 1 To .Columns.Count
'            .Cell(1, g).Select.Font.Bold = wdToggle
            .Cell(1, g).Shading.BackgroundPatternColor = wdColorYellow
        Next g
    
    End With

Make A Bold Toggle Button Like MS Word - Resolved
Everyone,

I have a rich text control and want to give the user the ability to insert formatting like bold, italics, and underline only. Through some playing around I found that a checkbox control using a graphical style is like a toggle button. I have also read through some other posts and have seen some various ideas about how to format the test in the RTF box. I would like the user to be able to just click the bold button begin typing in bold then click it again to turn it off or highlight a string and bold whatever is in the string. I've worked on this for about four hours, anyone have any ideas, thoughts, or references???

EDIT - Here's the link I finally found that solved my problem in case anyone else ever has this problem
Here's the site that helped me solve my problem
Learning how to do internet searches is actually harder than the programming language

rcw357
"The smartest man is the man who knows he knows nothing at all."


Edited by - rcw357 on 10/12/2003 12:00:23 PM

Reading A Row Of Table Of MS Word Picking Up Only Words In Bold Uppercase
hiya,
I m a newbie n we got this assignment to do at college.. so i was wonderin if you could please help me out..
its about MS Word and VB 6...Goes like this...
We have a table of data in MS Word. Using VB, we are supposed to read row by row and pick up only the words that are in bold uppercase. Is that possible? And then display it in VB.

Thanks in advance!

How To Count Words, And Individual Letters In A Word?
People, new here. Got a question to ask.

How to count words, and individual letters in a word? from a textfile?

Separating Letters From A Word (bmp Image In Picture Box) For Script To Text
hey i am really stuck at this point...
.... in my project i am converting gujarati script to text. i am successful to do it for single letters taken as bmp image in picture box.
................ ""now i want to separate out letters from word (in a picture box) to different picture boxes ( for each letter) ""
i am not able to do this separation........is there any way or well formulated method which i can apply in VB 6???


please suggest some ways or algos!!!

Bold/non-bold Text On CommandButton?
Is there any way to make PART of a CommandButton's Caption bold, and part of it not bold (normal)?

For example, if I wanted the first word to be bold and subsequent words to be NOT bold...how would one do that?

Bold Vs. Non Bold Printing On Same Line
I need to print bold and non-bold characters on the same line.

Printer.print "SHIP TO: " & "ANY TOWN"

I know printer.fontbold = true will make the entire line bold. However, I need:

"Ship to" in bold

"Any town" not in bold.

Can it be done?


Thanks

Geod

 

How To Change Letters Into Differant Letters
hi i want to be able to enter text into a text box and click a button and have certain letters changed into other letters e.g

ABCD to AGYU

How To Display Upper Case Letters In Text Box While Pressing Lower Case Letters
I want to Display Upper Case Letters in Text Box while Pressing Lower Case Letters, I tried with

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii >= 65 And KeyAscii <= 122 Then
    Text1.Text = UCase(Text1.text)
End If

End Sub

but it is printing in reverse , is there any other mothods.


Thank you.

How To Make Bold Text In One Textbox Bold In Another Textbox
I am writing a somewhat basic chat application, I was on the verge of releasing it when I spotted a bug. When I typed with bold text inside Text1, it only appeared normal inside Text2. Is there any way to have Text2 display the text formatting as well? I would also like to do this with the text colors.

Random Letters(not A Question On How To Generate Random Letters)
Hi,

My question is pretty straight forward...basically I'm generating random letters a - z and numbers 0 - 9...

I also have a combobox with numbers from 1 to 10 (which will be used to determine the length of the string ,ie,user picks 5,which should produce a list of random letters and numbers in a listbox

ts7gx
s93ks
3js9f
sxs0f

and so on and so on )

This is where my question begins ..

instead of using something like this :



Code:
Option Explicit
Dim schars as string
Dim sChar as string
Dim lchar as string
Dim tchar as string
Dim pchar as string


Private Sub Command1_Click()
lstnames.Clear

For i = 1 To txtamount.Text ' used to generate 1 to whatever number is typed into txtamount.text

schars = Chr$(Asc("a") + Int(26 * Rnd()))
sChar = Chr$(Asc("0") + Int(9 * Rnd())) + 1
lchar = Chr$(Asc("0") + Int(9 * Rnd())) + 1
tchar = Chr$(Asc("a") + Int(26 * Rnd()))
pchar = Chr$(Asc("a") + Int(26 * Rnd()))

if cbolength.text = "5" then

lstnames.AddItem schars & sChar & lchar & tchar & pchar 'which should procude a five character string.

end if

Next i
End Sub


would there be an easier/neater way of making the string 5 characters/numbers long(for example)without having to concatenate each variable,or even use that many variables to begin with ?

How To Convert Ascii Codes To Letters, And How To Uncode Letters To Ascii Codes?
how to convert ascii codes to letters, and how to uncode letters to ascii codes?
eg 65=a
a=65

Just Want To Bold??
I have a form to make a madlib. And the form works fine. However, when it brings up the box with the madlib in it and puts their answers into the appropriate spots, it won't bold them.

I've tried going into the text properties. And that doesn't work. Can anybody point me in the right direction for just bolding the variables in the final box?

If you want to see the little test madlib in action, I can send it to you.

I Want To Be Bold!
Why won't the following work

Code:
Private Sub mnuFont_Click()

' Set Cancel to True.
cdl1.CancelError = True
On Error GoTo ErrHandler
' Set the Flags property.
cdl1.Flags = cdlCFBoth
' Display the Font dialog box.
cdl1.ShowFont
' Set text properties according to user's selections.
rtb1.SelItalic = cdl1.FontItalic
rtb1.SelFontSize = cdl1.FontSize
rtb1.SelBold = cdl1.FontBold
rtb1.SelFontName = cdl1.FontName

Exit Sub
ErrHandler:
' User pressed Cancel button.
Exit Sub
End Sub

Edit
How do I change the background to white? The help says use "[code]"

Edit: We just recently added [vb][/vb] code tags

Bold
I need some help i am trying a text programme and i want in a text frame that the text chang to bold if they press on a botton plz help me

THX

Bold?
i want the first word on a particular field record is kind'a bold in output?

is it possible?

Bold Help
I Have A RichTextBox, and a picture that makes the selected text bold, how do i make the image, when clicked again, make the selected text not bold

To Bold, Or Not To Bold
I have searched high and low for the answer to this question, and have found nothing.

Is it possible to read a line from a text file and know if the text is bold or not?

Could Be Bold If It's Done In VB
Is it possible do a tool like Spyxx in VB5?

Well, as the subject reads, this could be bold if it's done in VB, it's about raking apps at Run Time, the goal, to know what Dll's are being called for the App (like Spyxx tool of VC++), all those who program in Visual C++ know what i am talking about. My question is, Is it possible do a tool like Spyxx in VB5 ?

Regards, Raúl gonzález. ^_^ /

Bold
i do i put just a part of a label in bold.

Turn Bold On And Off?
Please help! I have been trying to get this for several days.
I am creating a VB6 program that creates a report in Word. I would like to be able to turn bold on for certin words but not for others. all the methods that I have found turn it on or off for the entire document. Any suggestions?

Code:
Public Sub goreport()

Set objWordApp = GetObject("", "Word.Application.10")
objWordApp.Documents.Add Template:="C:
a.dot", NewTemplate:=False
objWordApp.Documents(1).content.Font.Name = "Courier New"
objWordApp.Documents(1).content.Font.Size = 10
objWordApp.Documents(1).content.Font.Bold = False
objWordApp.Documents(1).range.InsertAfter text:="Dear Sir or Madam:" & vbCrLf
objWordApp.Documents(1).content.Font.Bold = True
objWordApp.Documents(1).range.InsertAfter text:="text that should be bold" & vbCrLf
objWordApp.Documents(1).content.Font.Bold = False
' save and close the doc.
objWordApp.Documents(1).Saveas StrFileName
objWordApp.Documents(1).Close
objWordApp.Quit

End Sub

Copyright © 2005-08 www.BigResource.com, All rights reserved