Results 1 to 14 of 14

Thread: Reading SMS Inbox using VB.NET

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    44

    Smile Reading SMS Inbox using VB.NET

    Hi everyone. I'm currently doing a school project, which require me to build a Mobile Application which is strictly using VB.NET as the language and the Windows Mobile SDK 6.

    Here is my problem. I have found out how to recieve SMS messages when they are incoming and get their body text and use it to do something.

    However, I now need to get the existing messages in the SMS inbox as well as delete them.

    From my search on Google, I get plenty of weird results and codings ranging from C# to C++. However, my project require me to do it in VB.NET and that's the only language out of the three I know, so I cannot translate manually from C++ to VB.NET.

    So can anyone kindly please guide me and my project team on this? I appreciate it and thanks in advance.

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Reading SMS Inbox using VB.NET

    If you have C# examples you can convert the to VB with many internet converters.
    Also i think this forum has tons of examples for sms's . Do a search.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  3. #3
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: Reading SMS Inbox using VB.NET

    You need to check if it is available using the pocket outlook name space
    I seem to remember it isn't easily do-able without using MAPI or a 3rd party tool like InTheHand
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    44

    Re: Reading SMS Inbox using VB.NET

    Thanks for the quick responses. However, samples related to SMS inbox I find are all in C++. I'm manage to only find one person posting the same question without any responses. I'm not very sure.

  5. #5
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Reading SMS Inbox using VB.NET

    Oh come on. Did you search?

    Anyway.

    Here (C++,C#,VB)
    http://www.vbforums.com/showthread.php?t=498642
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  6. #6

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    44

    Re: Reading SMS Inbox using VB.NET

    Thanks, I'm trying to study the articles found in the links of the thread, but since I'm new in this area, I'm pretty much do not understand most of the things there.

    Basicly, I need to learn how to delete an SMS from the Windows Mobile 6 phone's inbox and I can specify the conditions to do it.

    Condition can include date recieved, sent by or by some primary index.

  7. #7
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Reading SMS Inbox using VB.NET

    Well i'm no expert in WM6 (pete can help you out) but i think there is a new outlook class that can do what you want very easy.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  8. #8

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    44

    Re: Reading SMS Inbox using VB.NET

    Thanks. I really hope someone could guide me along as I'm still pretty lost.

  9. #9

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    44

    Re: Reading SMS Inbox using VB.NET

    Code:
    Imports System.Text
    Imports System.IO
    Imports System.Windows.Forms
    
    Imports Microsoft.WindowsMobile.Forms
    Imports Microsoft.WindowsMobile.PocketOutlook.MessageInterception
    
    Public Class Class1
    
    Private Sub CountSMS()
    
    
       Try
                Dim smsAcc As SmsAccount
                Dim smsFdr As SmsMessageFolder
                smsFdr = smsAcc.Inbox
              MessageBox.Show("SMS Count: " & smsFdr.Count)
            Catch
               MessageBox.Show("Error: Unable to count!")
            End Try
    
    End Sub
    
    End Class
    Recently I went to get the InTheHand Library evaluation version to try. I went to experiment with the SMS Inbox and found one problem. I always get a NullReferenceException with the SmsAccount.

    I would like to ask, how do you retrieve the SMS Account from your windows mobile device?

    Thanks

  10. #10

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    44

    Re: Reading SMS Inbox using VB.NET

    Sorry... I really need help urgently... Can somebody who are very keen in this area please help me out? I really appreciate it.

  11. #11
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: Reading SMS Inbox using VB.NET

    I think MAPI is the only option, and the InTheHand control wraps MAPI for you. There is a good article here that should help, although it is written in c# you can use a translation site. It should give you more insight.
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  12. #12
    Member
    Join Date
    Aug 2008
    Posts
    35

    Re: Reading SMS Inbox using VB.NET

    Dim sess As New InTheHand.WindowsMobile.PocketOutlook.OutlookSession
    Dim smsAcc As SmsAccount = sess.SmsAccount
    Dim smsFdr As SmsMessageFolder
    smsFdr = smsAcc.Inbox
    MsgBox("SMS Count: " & smsFdr.Count)

  13. #13
    New Member
    Join Date
    Jul 2004
    Posts
    1

    Re: Reading SMS Inbox using VB.NET

    You can try this page of msdn. Here you get code and explanation of how to intercept incoming sms messages using vb.net .
    http://msdn.microsoft.com/en-us/library/bb932385.aspx

  14. #14
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Re: Reading SMS Inbox using VB.NET

    why did you bring up a thread that died on 28-Oct-2008?
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

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