Click here to Skip to main content
16,009,068 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: image button Pin
rwestgraham14-Apr-05 9:47
rwestgraham14-Apr-05 9:47 
GeneralUsing Wavelet in VB Pin
Anonymous14-Apr-05 2:25
Anonymous14-Apr-05 2:25 
GeneralRe: Using Wavelet in VB Pin
Dave Kreskowiak14-Apr-05 3:49
mveDave Kreskowiak14-Apr-05 3:49 
GeneralHighlighting Datagrid specific items Pin
bibipopopopo14-Apr-05 1:26
bibipopopopo14-Apr-05 1:26 
GeneralRe: Highlighting Datagrid specific items Pin
Dave Kreskowiak14-Apr-05 3:45
mveDave Kreskowiak14-Apr-05 3:45 
GeneralMS chart control Pin
Mr Dabbah13-Apr-05 22:57
Mr Dabbah13-Apr-05 22:57 
GeneralMS Office document preview in windows form. Pin
satano66613-Apr-05 20:39
satano66613-Apr-05 20:39 
Questionhow to do this in windows service Pin
MagicGirL8313-Apr-05 14:52
MagicGirL8313-Apr-05 14:52 
i have this code and i want this as a windows service.
i like this to execute every 20 secs


Dim olapp As New Outlook.Application
Dim olNs As Outlook.NameSpace
Dim myrecipient, myfolder
Dim myitems As Outlook.Items
Dim mymail As Outlook.MailItem
Dim myitem As Object
Dim myConnection As SqlConnection
Dim myCommand As SqlDataAdapter
Dim cmd As New SqlCommand
olapp = CreateObject("Outlook.application")
olNs = olapp.GetNamespace("MAPI")
myrecipient = olNs.CreateRecipient("someusername")
myrecipient.resolve()
If myrecipient.resolved Then
myfolder = olNs.GetSharedDefaultFolder(myrecipient, Outlook.OlDefaultFolders.olFolderInbox).Items
End If

myitems = myfolder
myConnection = New SqlConnection("Data Source=.....")
myCommand = New SqlDataAdapter
myitems = myitems.Restrict("[Unread] = true")
myConnection.Open()

For Each myitem In myitems

On Error Resume Next
cmd = New SqlCommand("Insert into NewMessages (EntryID,SenderName,Subject,ReceivedTime,Body,UnRead) values(@EntryID ,@SenderName,@Subject,@ReceivedTime,@Body,@UnRead)", myConnection)

cmd.Parameters.Add(New SqlParameter("@EntryID", SqlDbType.Variant))
cmd.Parameters("@EntryID").Value = myitem.entryid
cmd.Parameters.Add(New SqlParameter("@SenderName", SqlDbType.NVarChar, 100))
cmd.Parameters("@SenderName").Value = myitem.sendername
cmd.Parameters.Add(New SqlParameter("@Subject", SqlDbType.NVarChar, 1000))
cmd.Parameters("@Subject").Value = myitem.subject
cmd.Parameters.Add(New SqlParameter("@ReceivedTime", SqlDbType.DateTime))
cmd.Parameters("@ReceivedTime").Value = myitem.ReceivedTime
cmd.Parameters.Add(New SqlParameter("@Body", SqlDbType.Variant))cmd.Parameters("@Body").Value = myitem.Body
cmd.Parameters.Add(New SqlParameter("@UnRead", SqlDbType.NChar, 5))cmd.Parameters("@UnRead").Value = myitem.UnRead
cmd.ExecuteNonQuery()

Next myitem

myConnection.Close()
olapp = Nothing
olNs = Nothing
myrecipient = Nothing
myfolder = Nothing
myitem = Nothing
myitems = Nothing
myrecipient = Nothing


i've already created a service for this one but, on its first start, it extracts unread mails, but when new mails come, it does not extract anything and when i checked on the application log it says, Microsoft Office 11 - Rejected safe mode action - Microsoft Outlook. on the system log: DCOM - The server {0006F03A-0000-0000-C000-000000000046} did not register with DCOM within the required timeout. I already uninstalled and killed the service but i'm still getting this errors on the eventlog. why is this so? i think i messed everything up.Confused | :confused: :'( please help me resolve this.. Confused | :confused: Confused | :confused: Confused | :confused:


Generalmailing + smtp Pin
_tasleem13-Apr-05 12:43
_tasleem13-Apr-05 12:43 
GeneralVB.NET Display Month in Text Not Number Format Pin
Anonymous13-Apr-05 11:24
Anonymous13-Apr-05 11:24 
GeneralRe: VB.NET Display Month in Text Not Number Format Pin
dpagka14-Apr-05 5:20
dpagka14-Apr-05 5:20 
GeneralWindows.Forms.DataGrid and NumericUpDown and/or DateTimePicker controls Pin
dprima13-Apr-05 10:31
dprima13-Apr-05 10:31 
QuestionWhat's the best way to do? Pin
Lisana13-Apr-05 9:42
Lisana13-Apr-05 9:42 
AnswerRe: What's the best way to do? Pin
Dave Kreskowiak14-Apr-05 5:21
mveDave Kreskowiak14-Apr-05 5:21 
GeneralVb 6.0 Pin
Bahadir Cambel13-Apr-05 7:39
Bahadir Cambel13-Apr-05 7:39 
GeneralRe: Vb 6.0 Pin
Dave Kreskowiak13-Apr-05 8:24
mveDave Kreskowiak13-Apr-05 8:24 
GeneralRe: Vb 6.0 Pin
Bahadir Cambel13-Apr-05 11:31
Bahadir Cambel13-Apr-05 11:31 
GeneralRe: Vb 6.0 Pin
Bahadir Cambel13-Apr-05 11:57
Bahadir Cambel13-Apr-05 11:57 
GeneralRe: Vb 6.0 Pin
rwestgraham13-Apr-05 12:58
rwestgraham13-Apr-05 12:58 
GeneralRe: Vb 6.0 Pin
Bahadir Cambel13-Apr-05 14:15
Bahadir Cambel13-Apr-05 14:15 
GeneralRe: Vb 6.0 Pin
Christian Graus13-Apr-05 15:12
protectorChristian Graus13-Apr-05 15:12 
GeneralRe: Vb 6.0 Pin
rwestgraham13-Apr-05 19:15
rwestgraham13-Apr-05 19:15 
GeneralRe: Vb 6.0 Pin
Christian Graus13-Apr-05 19:28
protectorChristian Graus13-Apr-05 19:28 
GeneralRe: Vb 6.0 Pin
rwestgraham13-Apr-05 21:05
rwestgraham13-Apr-05 21:05 
GeneralRe: Vb 6.0 Pin
Christian Graus14-Apr-05 0:10
protectorChristian Graus14-Apr-05 0:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.