• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

microsoft exchange server/outlook/VB

Have you ever used Microsoft Outlook? If yes, then here is the question : if you open tasks in outlook, a spread sheet will open with a header column and if you click on one of the rows, an assign task window will open. i want to incorporate the same in to my VB application. can somebody please direct me as to how to go about it? intially i am giving 50 points, but i can increase the points accordingly.
thanks in advance,
vmano.
0
vmano
Asked:
vmano
  • 4
  • 3
1 Solution
 
bin_huwairibCommented:
vmano,

vmano,

Basically Task spreadsheet is a special control but you can do something similar to it using List View control with LVS_EX_GRIDLINES and LVS_EX_CHECKBOXES extended styles and use the List View's DblClick to activate the Task details form.

Example
=======
Private Const LVM_FIRST = &H1000
Private Const LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 54
Private Const LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 55
Private Const LVS_EX_GRIDLINES = &H1
Private Const LVS_EX_CHECKBOXES = &H4

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal lpMsg As Long, ByVal dwParam As Long, ByVal lpParam As Long) As Long

Private Function LVXCheckBoxes(lvw As ListView, bMode As Boolean) As Boolean
 Dim X As Long, dwStyle As Long
 
 LVXCheckBoxes = True
 dwStyle = SendMessage(lvw.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
 If bMode Then
  dwStyle = dwStyle Or LVS_EX_CHECKBOXES
 Else
  dwStyle = dwStyle Xor LVS_EX_CHECKBOXES
 End If
 X = SendMessage(lvw.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle)
End Function

Private Function LVXGridLines(lvw As ListView, bMode As Boolean) As Boolean
 Dim X As Long, dwStyle As Long
 
 LVXGridLines = True
 dwStyle = SendMessage(lvw.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
 If bMode Then
  dwStyle = dwStyle Or LVS_EX_GRIDLINES
 Else
  dwStyle = dwStyle Xor LVS_EX_GRIDLINES
 End If
 X = SendMessage(lvw.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle)
End Function

Private Sub Form_Load()
 ListView1.ColumnHeaders.Add , , " ", 10
 ListView1.ColumnHeaders.Add , , "Subject", ListView1.Width / 2
 ListView1.ColumnHeaders.Add , , "Due Date", ListView1.Width / 2
 LVXGridLines ListView1, True
 LVXCheckBoxes ListView1, True
End Sub

Private Sub ListView1_DblClick()
 Form2.Show
End Sub


Best regards
Bin Huwairib
0
 
vmanoAuthor Commented:
i am very sorry to say that your code is not at all working. do i have to do anything else other than your code? please respond.
thanks,
vmano
0
 
bin_huwairibCommented:
How it is not working? do you get any error message? please explain more.

Bin Huwairib
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
vmanoAuthor Commented:
i did put a listview control on my form and and also your code accordingly. when i run it, it just don't do anything except for a blank list view on the form. no error messages also. please let me know if you want more info.
thanks for responding,
vmano.
0
 
vmanoAuthor Commented:
OK. let me rephrase the question.
i am developing a case management system and are trying to integrate the user interface to include a view of a users outlook tasks in our main window. i would like to find an ocx or something to use to connect to the exchange server without making our users open outlook.
hope this is much more clear as to what i am looking for.
thanks in advance,
vmano


0
 
bin_huwairibCommented:
vmano,

Replace Form_Load sub with the following:

Private Sub Form_Load()
 ListView1.View = lvwReport
 ListView1.ColumnHeaders.Add , , " ", 10
 ListView1.ColumnHeaders.Add , , "Subject", ListView1.Width / 2
 ListView1.ColumnHeaders.Add , , "Due Date", ListView1.Width / 2
 LVXGridLines ListView1, True
 LVXCheckBoxes ListView1, True
End Sub

Bin Huwairib
0
 
MirkwoodCommented:
Bought This Question.
0
 
vmanoAuthor Commented:
MirkWood,
What is this all about "BUYING"? Can you tell me more about this buying questions?

vmano
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now