Results 1 to 6 of 6

Thread: Spliting data

  1. #1

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172

    Unhappy Spliting data

    I am working on my own msn messenger.. but i want to split some info that i get from the server to go to some new variables :S


    MSG Hotmail Hotmail 348
    MIME-Version: 1.0
    Content-Type: text/x-msmsgsemailnotification; charset=UTF-8

    From: Jeroen
    Message-URL: /cgi-bin/getmsg?msg=MSG1021213648.24&start=9940&len=456&curmbox=ACTIVE
    Post-URL:****************
    Subject: sdsdds
    Dest-Folder: ACTIVE
    From-Addr: **********@hotmail.com
    id: 2


    i want to get the SUBJECT.. and the FROM info :S can anybody oh and the from adress might be usefull to help me with it?
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. Private Sub Command1_Click()
    2. Dim sArr() As String
    3. Dim sTmp As String
    4. Dim sMsg As String
    5. Dim sFromInfo As String
    6. Dim sFromAddress As String
    7. Dim sSubject As String
    8.  
    9.     Open "C:\message.txt" For Binary As #1
    10.         sMsg = Input(LOF(1), 1)
    11.     Close #1
    12.    
    13.     sTmp = Split(sMsg, "From:")(1)
    14.     sFromInfo = Split(sTmp, vbCrLf)(0)
    15.    
    16.     sTmp = Split(sMsg, "Subject:")(1)
    17.     sSubject = Split(sTmp, vbCrLf)(0)
    18.    
    19.     sTmp = Split(sMsg, "From-Addr:")(1)
    20.     sFromAddress = Split(sTmp, vbCrLf)(0)
    21.    
    22.     Debug.Print sFromInfo
    23.     Debug.Print sFromAddress
    24.     Debug.Print sSubject
    25. End Sub

    assuming the format of the message is constant.
    -= a peet post =-

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    the short and unreadable version

    VB Code:
    1. Debug.Print Split(Split(sMsg, "From:")(1), vbCrLf)(0)
    2.     Debug.Print Split(Split(sMsg, "Subject:")(1), vbCrLf)(0)
    3.     Debug.Print Split(Split(sMsg, "From-Addr:")(1), vbCrLf)(0)

    ... uh... I need a life...
    -= a peet post =-

  4. #4

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    thnx.. i needed the last one.. because it will be put in a caption thnx allot m8.. so if i am correct it will get the info after FROM: and in front of a VBCRLF?
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  5. #5
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    yepp
    -= a peet post =-

  6. #6

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    thnx allot that helped allot ya know.. now i can do much more of the stuff i wanted ... gonna add ya in the special thanks to: :P
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

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