Results 1 to 8 of 8

Thread: Saving text that is centered(resolved)

  1. #1

    Thread Starter
    Hyperactive Member shizzy's Avatar
    Join Date
    May 2005
    Location
    Michigan
    Posts
    278

    Resolved Saving text that is centered(resolved)

    Hello friends,

    I've got a problem with my save methods, they are not working correctly. I have a rich text box where I can have text in and then center it, but when I save and open it back up, the text is not centered... here is my code

    VB Code:
    1. strSave2 = txtFinalTab.Text
    2.  
    3.         cdlSave.DefaultExt = ".txt"
    4.         cdlSave.Filter = "Text (*.txt)|*.txt|Word document (*.doc)|*.doc|Rich Text(*.rtf)|*.rtf"
    5.         cdlSave.ShowSave
    6.    
    7.         strSave = cdlSave.FileName
    8.    
    9.         If cdlSave.FileName = "" Then
    10.             Exit Sub
    11.         End If
    12.        
    13.         Open strSave For Output As #1
    14.             Print #1, strSave2
    15.         Close #1
    Last edited by shizzy; Sep 5th, 2005 at 06:08 PM.
    In rare occasion, if I help you, give me some rate points. They help me sleep at night
    WMRR Rockin' the Lakeshore! For all your guitar music needs! For all your guitar purchasing needs!
    AC/DC Rocks! Van Halen! Led Zeppelin!

    my webpage

  2. #2
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Saving text that is centered

    Thats because the richtextbox has its own save method, and its own read method. Try those two instead of the regular .txt way

  3. #3

    Thread Starter
    Hyperactive Member shizzy's Avatar
    Join Date
    May 2005
    Location
    Michigan
    Posts
    278

    Re: Saving text that is centered

    Well i'm not sure exactly how to use the rtb save method, so maybe you can show me?
    In rare occasion, if I help you, give me some rate points. They help me sleep at night
    WMRR Rockin' the Lakeshore! For all your guitar music needs! For all your guitar purchasing needs!
    AC/DC Rocks! Van Halen! Led Zeppelin!

    my webpage

  4. #4
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Saving text that is centered

    Maybe this?

    VB Code:
    1. RichTextBox1.LoadFile "C:\somefile.rtf"
    2.  
    3. 'and
    4.  
    5. RichTextBox1.SaveFile "C:\somefile.rtf"

  5. #5

    Thread Starter
    Hyperactive Member shizzy's Avatar
    Join Date
    May 2005
    Location
    Michigan
    Posts
    278

    Re: Saving text that is centered

    thanks alot baja
    In rare occasion, if I help you, give me some rate points. They help me sleep at night
    WMRR Rockin' the Lakeshore! For all your guitar music needs! For all your guitar purchasing needs!
    AC/DC Rocks! Van Halen! Led Zeppelin!

    my webpage

  6. #6
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Saving text that is centered(resolved)

    No problem

  7. #7
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Saving text that is centered(resolved)

    You can save as text or rtf
    VB Code:
    1. Private Sub cmdSaveFile_Click()
    2.   rtb.SaveFile App.Path & "\save.rtf", 0 ' 0=RTF 1=TEXT
    3. End Sub

  8. #8
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Saving text that is centered(resolved)

    Quote Originally Posted by dglienna
    You can save as text or rtf
    VB Code:
    1. Private Sub cmdSaveFile_Click()
    2.   rtb.SaveFile App.Path & "\save.rtf", 0 ' 0=RTF 1=TEXT
    3. End Sub
    A nice addition!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width