Changing Font Styles When Sending Values To Text File
I'm not sure if this is possible, and probably not but can you change the font style when sending values to a text file using the print command?
like:
print #1, [ bold ] "blah blah" [/ bold ]
thanks
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Retain Font Styles When Changing Font Size
March 25, 2008
Re: VB6
Hello, everyone. I searched for over two hours for an answer but didn't find a relevant forum example. I am using a richtextbox for my documentation. I made several simple font features such as font sizes and font styles (bold and underline) to the richtextbox. The problem I have is that after I bolded and underlined some of my document text, if I change my document to a different font size, any text that have been bolded or underlined will be undone, so I have to highlight them and bold or underline them again. Does anyone have any advice or any example code to correct it?
The following is a fragment of code in selecting for fontbold and for changing font size:
If Len(Trim(RichTextBox1.SelText)) > 0 Then' For selecting text
RichTextBox1.SelFontSize = 14
End If
RichTextBox1.SelBold = Not (RichTextBox1.SelBold)' For selecting text for bold
RichTextBox1.Font.Size = 14 ' Font size to the whole document or richtextbox
Any advice or help will be greatly appreciated.
Mydanvue
Sending Values Multiple Values To ONE Word File[Resolved Like A Horny Ho']
I have searched for how to do this and have the code to start up a word app: (thanks to Carl)
Option Explicit
VB Code:
Private Sub Command1_Click() Dim WordApp As Word.Application Set WordApp = New Word.Application With WordApp 'create word app from default template .Documents.Add "Normal.dot" 'don't ask me to save before quiting! .DisplayAlerts = wdAlertsNone 'show the word window .Visible = True 'active the window .Activate 'send text to the window .Selection.Text = "Hello World!" 'print the page .PrintOut 'wait for document to print before quiting Do While WordApp.BackgroundPrintingStatus Loop 'quit .Quit End With Set WordApp = Nothing End Sub
But what I need to do is have users check the fields who's values they want to include in a report and have the word file as the report. Here's a GIF of what I mean:
The checkboxes indicate the values and field names to be included in the word document.
Does anyone know how to do this/a tutorial for this?
thank you xxxx
Font Styles In A List Box
Hi
I have a list on my program. I want to the listbox to display a line of text but i want a few of the words in bold. I currently have
List1.AddItem ("Click Yes, No or Cancel")
I want the Yes, No and cancel in bold
Can this be done?
Changing Font Properties In Rich Text Box
I am making an application in which the computer will dialog with the user about any problem and the user can answer in "yes" or "no".
I have used rich text box for displaying the conversation. Now i want that whatever questions asked by computer should appear as bold and italic and the answer by user (yes or no) apear in noramal text with a different colour. (like chating software msn or yahoo have different colours for both persons)
How can i change the font proerties at every line. When i used the setfont proerty it change the whole rich text box properties.
Changing Font/color/bold Of Certain Text..
say i have 2 buttons... each button enters text into a textbox... the same textbox... and it adds it all together so there on top of eachother...
like this
-------------------------------------------------------
| Button 1 text |
| Button 2 text |
-------------------------------------------------------
now say i want to change the bold to the button 2 text... and only make that bold.. or change the color... but the button 1 text stays the same... now of course i would set this before i wrote to the textbox.. but any ideas... how i can just change the color to say one line of the textbox instead of the whole textbox...
Zooming/Changing Web Browser Text Font Sze....
Zooming/Changing web browser text font sze....
I saw this done on planetsourcecode.com, but it only had 5 sizes, and didn't change the size very much at all. Is there a better way of doing this that changes the size even more??
Changing The Font Style Of The SELECTED Text Only???
Hi folks,
The following codes changes the style (Bold, italic, underline) of the whole text in the text box. I want to know how to change the style of the selected text only. Your help would be appreciated greatly. Thanks
Regards
Code:
Private Sub mnuFormat_Click()
If Text1.SelText = "" Then
mnuFormatBold.Enabled = False
mnuFormatItalic.Enabled = False
mnuFormatUnderline.Enabled = False
Else
mnuFormatBold.Enabled = True
mnuFormatItalic.Enabled = True
mnuFormatUnderline.Enabled = True
End If
End Sub
Private Sub mnuFormatBold_Click()
If mnuFormatBold.Checked = True And mnuFormatBold.Enabled = True Then
With Text1.Font
.Bold = False
End With
mnuFormatBold.Checked = False 'places an check mark
Else
With Text1.Font
.Bold = True
End With
mnuFormatBold.Checked = True 'removes an check mark
End If
End Sub
Edited by - szewari on 12/25/2003 9:27:08 AM
Changing Font Color Cause Text Box To Flicker
If my rich text box control has more text than can currenlty be dispalyed at one time and I change the font color of all the text in the text box, the rich text box will flicker. If the total text in the rich text box does not fill up the entire rich text box dispaly area, I can change any text font color and I do not get any flicker. Is there any way to prevent this repaint event from occuring?
my code is pretty simple:
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Text1.SelColor = NormalFontColor
Changing Font Color In Rich Text Box
Hi, can u tell me how to change the font color in rich text box control..
I want few
line color to in red
and few in blue
and few in black.
how to get this.
thanks in adv.
venu
Different Font Styles Apply To Same Table
Hi,
I need to generate data in a table from ACCESS database. Those data are in numeric value. The request is, I need to put 2 values (which is in different unit measurement) in a single table cell. So, to differentiate it, 1 of the value need to be bold sized.
My problem is, I do not know how to bold sized one of the value, instead, what I can do is only to bold sized everything in a cell, but not the particular value.
Can anyone please give me some advice? I have been working on it for days...
Thanks!
Richtextbox Text Changing Color When Font Size Changes
Hello,
I have code to change the font size of the text in my Richtextbox, but when it does change the font size, it also changes the color of whatever the text currently is to black. In other words, if the text is currently red or blue, it will change the text to black.
Code:
combo1.additem "8"
combo1.additem "9"
combo1.additem "10"
combo1.additem "11"
combo1.additem "12"
combo1.listindex = 0
Private Sub Combo1_Click()
RichTextBox1.SelStart = 0
RichTextBox1.SelLength = Len(RichTextBox1.TextRTF)
RichTextBox1.Font.Size = Combo1.Text
End Sub
Anyone have any ideas why this might be happening ?
Thanks...
TextBox-Changing Font And Style Of Partial Text
Hi everyone, I have the following issue
I would like to select a determined string in a text box, and change the different properties of a text such as the font, size and style. I review the library but I couldnt find an specific solution for a partial string. I mean if i applied the following code -TextBox1.Font.Italic-, the whole text will change. However I want to change just a simple substring in Textbox1, like the MS Word editor.
Could you help me with this issue.
Thanks in advance for your support folks
Changing Font Size In Text Mode Printing
Hi guys...
I'm printing from my application in text mode. That is by using API functions such as OpenPrinter, StartDocPrinter, WritePrinter etc. My problem is that I need a better way to set the font size. At the moment I'm Doing it by appending chr$(15), chr$(18) etc before the string to be printed.
I just want to know whether there is any other better options to specify the font size.
I'm using VB 6.0 and Windows 98
Changing Font In A Saved File???
Hey, i'm working on a barcode type program. They need the file saved, but I need to have a barcode generated. Now they are just using a barcode font (the people we send the file too). So I have the font, and the result is in a textbox, with the correct font & size.
The problem I have is how do I save a file with the result saved in that font?
They want to have this program as automated as possible, so don't want to have to open it up ltr to change fonts etc.
I need to be able to print it off in a form etc.(which I will have to get to later. I have no idea how to do that yet. lol)
Is it possible to save the textbox into a file other than simple textfile like notepad?
Is there a way to change the font in the textfile?
Any suggestions would be greatly appreciated.
Changing Textbox Text Font Type/Size, Bold, Italic, Underline And Color
Hi everyone, this is urgent.
I have a textbox where user can type in there. When user select (highlight) the text they can change the font, size, Bold, Italic, Underline and/or color. It should work like in MS Word.
How do I do this? I have a combo box for Fonts, a combo box for Size, and 4 command buttons for B, I, U, and Color.
Please help?
Thanks
Vb2005 Need Help With Changing Text Color For Values In Messagebox . ..
i have these lines of code below and i want to change the text color for the underlined values only in the messagebox.. not in the textbox
they'r actually masked textboxes..
msg = "Are you sure you want to proceed with this booking?" & vbCrLf & "Seats booked: " & seats.ToString & _
vbCrLf & "total cost: " & total.ToString("c") & vbCrLf & "Adults: " & Me.mskadult.Text & vbCrLf _
& "Senior consessions: " & Me.msksenior.Text & vbCrLf & "Student consessions: " & Me.mskstudent.Text _
& vbCrLf & "Children below 3: " & Me.mskchild.Text & vbCrLf & "Free tickets: " & Me.mskfree.Text
result = MessageBox.Show(msg, "Proceed?", _
MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
If result = Windows.Forms.DialogResult.No Then
MsgBox("Order canceled")
i want to change the color of the underlined textbox values to red so my msg can be read properly. i dont want to change the color of text in the text box
just in the messagebox... thanks for any help
Why Changing Values When Open .xls File?
I made a simple progam to get data from .xls file.
I am using the following code:
Set shtmic = mic.Workbooks.Open(App.path & "1.xls")
Everything works fine!
But before I run the program I see in the 1.xls file that the values of the column is something like 3,44 E-02 (scientific format).
After I run the program the values in the 1.xls file become 3,44 E+04.
Why???????
I figure out that this change happens after the Set shtmic = appmic.Workbooks.Open(App.path & "1.xls") command
Unfortunately I can't change the format of the source file.
Can anyone help me?
Thanks in advance.
Option1.Forecolor Not Changing If Visual Styles Enabled?
Option1.Forecolor not Changing if Visual Styles Enabled?
Very interesting...
If i have a noraml option1 in vb that has a red colour to it.. and when i compile and add the manifest file etc.. to make it XP style the Option.Buttons seem not to be changing colour. but staying black..!
How could this be fixed?
Changing Cells Values After Opening File
Code:
Public Sub HPC3906A(frmStarterform As Form)
Dim objExcel As Excel.Application
Dim xlWB As Excel.Workbook
Set objExcel = New Excel.Application
If Startertype = 1 Then
Set xlWB = objExcel.Workbooks.Open(App.Path & "C3906A_R Starter.XLS")
Else
Set xlWB = objExcel.Workbooks.Open(App.Path & "C3906A_O Starter.XLS")
End If
'what do I add here to change a cell value for
'example cell "A30" value = "Print 500 5% Pages"
objExcel.Dialogs(xlDialogPrint).Show 'opens print dialog box
CleanUp:
Call xlWB.Close(SaveChanges:=False)
objExcel.Quit
Set objExcel = Nothing
End Sub
Changing Default DC Font To MsFlexGrid.Font.Name
When I need to obtain a font LONG value for a command button, I make the following:
ButtonFont = SendMessage(Command1.hWnd, WM_GETFONT, 0&, 0&)
I need to do the same for a MsFlexGrid and the function returns 0.
In this case, and because I need to change de default Device Context font (SYSTEM) to the MsFlexGrid.Font.Name, I'm unable to change it.
How can this question be solved ?
Thanks in advance
Changing Font Size And Bold And Font ???
dim Heading as string
Heading = "I want to Make this sentance Bold and bigger"
how would i go about making this variable bold and changing the font and font size.
thankyou
Set Font For The Text File Using Vb 6.0
hi all..
i had created a pdf-text conveter.. i just want to set the font for that text file using vb 6.0..the font value has to remain when i re-open..please provide me some suggestion..
Text File Opties (font/papierformaat)
Is it possible to to this with a text file:
- Define a font name for it by creating the text file
- Define the marges of the printer for it in the txt file.
My code:
Open "c: est.txt" For Output As #1 'App.Path &
Print #1, "Mijn teksten"
Close #1
Controlling Font When Printing 2 Text File
When sending text from a VB program to a text file, is there any way to control the font of the text inside the *.txt file?
Can someone tell me how to control the font style & size in my very simple program below?:
Private Sub cmdWrite_Click()
If cmdWrite.BackColor = vbGreen Then
cmdWrite.BackColor = vbRed
Else
cmdWrite.BackColor = vbGreen
End If
Open "c:Anakin_write.txt" For Output As #3
Print #3, "Anakin_Data: ";
Write #3, txtAnakin.Text
Close #3
End Sub
Private Sub Form_Load()
txtAnakin.Text = "Type something here"
cmdWrite.BackColor = vbYellow
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Thanks!
About Changing Cell Values To Absolute Values..
Hi there. I got a worksheet containing 3 columns of thousand values. In colume 3, cell values were set as "=a value in column a", eg value of range c2 ="=a3". However, after filling in values in column 3, I tried to sort the values in column 3 in alphabetic order, the values in columns 3 were changed to "=REF!". I know it's about values not being set to absolute values. As there are thousands of values in column 3, Can I use VBA code to change them to absolute values once for all (e.g. change "=a3" to "$a$3)?
Cheers.
View Text Using CSS-Styles
Hi,
is there a way to make RichEdit/Textedit EDIT AND show Text using original CSS-Styles with all its features?
I basicly need to make a text-editor where you can edit AND view Text using original CSS-styles, 1:1 as you would see it later in a Browser. The user is not allowed to mark Text to make it bold/italic etc.., he has to use a CSS-Styles to format his Text.
There is a great OCX-control (http://nbit.net.au/home.aspx) where you can edit a Webpage in WYSIWYG-style, but this OCX handles all Keyboard-input by itself and doesn't have any .selstart, .selenght etc. methods. Its useless for my 'Straight CSS-Style Texteditor".
Thanks in advance for anything pointing me into the right direction.
Run A Bat File And Sending Text To Cmd.exe?
How do I do if I want to run a Bat file from VB, wait 4 seconds until the Bat file has started a program.
Then I want to use SendKeys to send some commands. When it's finished, close the cdm.exe. I wanna do all this in hidden mode.
I really need help here.
I have come this far:
VB Code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, _ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _ByVal nShowCmd As Long) As LongPrivate Declare Function PostMessage Lib "user32.dll" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As LongPrivate Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As LongPrivate Const WM_CHAR As Long = &H102 Private Const SW_SHOWDEFAULT As Integer = 10Private Const SW_HIDE As Integer = 0 Private Sub Command1_Click() Dim h As Long ShellExecute Me.hwnd, "open", "C:Test.bat", vbNullString, "C:", SW_HIDE h = FindWindowEx(0, 0, "ConsoleWindowClass", vbNullString) If h Then PostMessage h, WM_CHAR, Asc("Test"), 0End Sub
Detecting The Current Font And Font Size On Various Lines In A Rich Text Box.
I have written an editor that uses a rich text box as the main text area.
The editor allows the user to select a font and font size on the toolbar.
My question is, how does one get the combo box text (for both the font and font size) to display the font or font size for the current line of the current character location?
Meaning, if I were to type in two lines, the first line being Arial 12pt, and the second line being Tahoma 14pt, how would I get the program to display the font and font size in the combo boxes?
I know about SelFont, SelStart and such, but I am not selecting any text. I am merely moving the cursor up or down and need to be able to display the font and font size for where the cursor currently is.
Anyone have any ideas?
I thank you in advance.
CoolBar+XP Styles+Toolbar <> XP Styles
I am having trouble getting the styles on the toolbar and coolbar to work together. When I add a manifest file the project the coolbar gets the new XP style and the toolbar is still flat and gray. Is there anyway around this?
Sending A Text File To A Web Server
I wrote a program (P1) that keeps control of another program (P2) and checks if it crashes or closes normally, and when it crashes, I want it to send the logfile to my website. Now I want to know, how can I send this logfile? Is there any useful information you can link me to? What would be easiest to use, ftp or http? Is using ftp unsafe?
Thanks in advance!
Help Sending Data To A Text File
Okay, i'm making a level editor for my snake game (rattler race clone), and i need help sending the data to a text file when the level is ready to be saved. I made a control array of command buttons (62 wide and 39 high). The control array is called igrid. So, it goes from igrid(0) to igrid(2417). I have it set up so that when you click on a button, it changes from the standard button color to black. Then, if you click one that is already black, it changes it back to the standard button color. I'm trying to figure out the easiest way to transmit this data into a csv file with 1's and 0's (1's for squares w/ wall, 0's for squares w/o wall). Can somebody help me out?
To work best with the other part of my game, the rows need to be preserved....so the first 62 would need to be on line 1, then it would end up being 39 rows of text for 1 level. Thanks ahead of time.
Sending Info To Text File
I have a VB project which contains a form that has text boxes and a list box the user enters the drive of the computer they want to search and the details are displayed in the list box.
I want to be able to send this data in the list box to a text file, how do i do this?
Sending Text File Using SFTP
We have to send a text file every day to our vendor using SFTP(Scure File Transfer protocol). We are windows platform and using visual basic we want to do that. Any Ideas about SFTP with Win32 will be helpful for us.
Thanks,
Sam.
Sending A Text File To A FTP (Winsock)
Hi,
I've searched this forum for any good methode to send a ascii file, or any file to a FTP using Winsock.
My problem:
I have a file, standard txt file and I want to send it to a FTP server.
Now I have made a connection with USER, PASS and now I want to STOR a file. The ftp tells me '150' so it ready to receive. But How do I send?
can anyone give me a code example on how to do this?
Thx in advance...
Detecting Font And Font Size On Various Lines In A Rich Text Box.
I have written a basic editor that uses fonts and such, however when I select a different line (while entering text into the text area of the rich text box), it doesn't display the font or font size for that particular location.
Does anyone have any ideas where I can look to solve this problem?
I thank you in advance for any information you may be able to share with me.
How To Save Text Fontsize, Font Style And Font Color
When I save the text in a Richtextbox to a Access Database, How to save the font style and Font color with the text (Assume that user can change font style and color when they typing text into the richtextbox).
Then when I load the text from Access Database back to the Richtextbox, it should associate with it's font style and color when I was saved.
How to realize these functions???
Thanks in advance
Changing A Text File
I am kind of a noob only having learned VB in high school and i am making a program to keep track of catering orders at my work.
i want to be able to delete a line from the text file i have saved the order information to.
i read all the names to a listbox from the txt file. how will i be able to click on a name in the listbox and a "Remove" command button to remove the info from the file? thanks
Changing Text In A .txt File
my project writes information to a .txt file, i know how to delet a word or line in a .txt file but if i want to just change the string and it stay at the same line in the .txt file?
|