Similar Threads:
1.change font color, type,or style
hello i was wondering is it possible in visual basic .net to change the
color of certain words or phrases without changing the color of all the
text in the lable or without having to create a new lable specificly
for that word or phrase
thanx
2.Word 2002 SP3 - change font color creates new style - breaking mac
Help!
I had slowly put together macros that would take a tab delimited database
dump -- a list of names and codes and numbers -- off of our mainframe, and
turn it into a nicely formatted office phone directory.
I did this entirely with styles -- no direct formatting. But I used
character styles that only changed font colors -- so I could find a unique
long string (containing for example a foreign city name and an eleven digit
number) and paint that green, then find a string of eleven green numbers and
break it up into four numbers, hyphen, three numbers, hyphen, four numbers.
This broke completely with Word 2002 -- Word 2002 creates a new named style
if I apply a character style that includes changing the font color of the
character. So my subsequent searches don't find the characters, because
Word has changed their style name and my search doesn't know what they're now
called.
I suppose I should have used strikeouts or crawling ants or something
instead of colors. Now, what to do ....???
Any suggestion welcome -- ideally some way to turn off this new feature in
Word 2002 and make it leave the style names the way I create them.
I'm not a macro expert; I did this slowly by guess and by gosh, got some
help from experts who aren't available now -- so I can't just rewrite the
whole macro.
Any help welcome.
3.Word 2002 SP3 - change font color creates new style - breaking
4.change font color of tasks or color of bars from VBA
Hi!
How is it possible to change the fontcolor of a task or the color of a bar
from vba?
thx
5.getting font name, style, and color in a richtextbox w/o using .rt
hi, im creating an instant messenger using TCP sockets, and everythings been
fine until now. i want to be able to send rich text, but im hitting a wall
here. what i want to do is send the font name, style, and color before every
text so that way it will format it on the other end and display it in another
richtextbox. right now im trying to send the .rtf property but i cant add it
to the richtextbox...it just wont show anything and wont throw any
errors....so if someone could help me out here itd b great...heres the code
Private Sub ReceiveCallBack(ByVal ar As IAsyncResult)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''' Declarations ''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Static times As Integer = 1
Static newfile() As File = Nothing
Static strisfile As String = "text"
Dim bytes() As Byte = CType(ar.AsyncState, Byte())
Dim numbytes As Int32 = ClientSocket.EndReceive(ar)
Dim fs As FileStream
Dim br As BinaryWriter
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''' End Declarations ''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''Try block for text creation and file receiving
Try
''Catches a null declaration error in array bytes
If bytes Is Nothing Then
Exit Sub
End If
''if nothing sent, disconnect
If numbytes = 0 Then
ClientSocket.Shutdown(SocketShutdown.Both)
ClientSocket.Close()
Dim dlg As New NoParamsDelegate(AddressOf DisconnectedUI)
Me.Invoke(dlg)
''else, receive what is sent
Else
''get what was sent and convert to string using ASCII encoding
Dim recv As String = ASCII.GetString(bytes, 0, numbytes)
Dim tempclr As Color
''If recv is "File"
If recv.Substring(0, 6) = "[File]" Then
''tell to create file
strisfile = "[FileName]"
Exit Try
ElseIf recv.Substring(0, 7) = "[/File]" Then
''tell to show whatever is received next as text
strisfile = "text"
''flush streams
br.Flush()
fs.Flush()
''close streams
fs.Close()
br.Close()
Exit Try
End If
''if image variable is
If strisfile = "text" Then
If times = 1 Then
''sets back color
Dim tempstr As String =
recv.Substring(recv.IndexOf("[") + 1, (recv.LastIndexOf("]") -
recv.IndexOf("[") - 1))
tempclr = Color.FromName(tempstr)
times = 2
ElseIf times = 2 Then
''sets rtf formatting
Me.rtbreceivedtext.Rtf += recv & vbNewLine
''Me.rtbsendtext.SelectedText = recv
Me.rtbsendtext.ForeColor = tempclr
times = 1
End If
''if filevar is "File" then add recv to file
ElseIf strisfile = "[File]" Then
Dim tempbytes As Byte() = ASCII.GetBytes(recv)
br.Write(tempbytes)
''if filevar is "FileName" then create file
ElseIf strisfile = "[FileName]" Then
''create file
fs = New FileStream(Application.StartupPath & "/" &
recv, FileMode.Create, FileAccess.Write)
br = New BinaryWriter(fs)
''file var tell to create file
strisfile = "[File]"
End If
End If
Catch ex As Exception
Call WriteErrors("ReceiveCallBackFirstTryBlock", ex.Message)
End Try
''try block for array clearing
Try
'Clear the buffer
Array.Clear(bytes, 0, bytes.Length)
'Begin Receive Again
ClientSocket.BeginReceive(bytes, 0, bytes.Length,
SocketFlags.None, AddressOf ReceiveCallBack, bytes)
Catch ex As Exception
Call WriteErrors("ReceiveCallBackSecondTryBlock", ex.Message)
End Try
End Sub
--
-iwdu15
6. changing font color in named range using vba
7. Changing the font color using VBA
8. Changing font style/size/color/etc for multiple series in a ch