Solved

microsoft exchange server/outlook/VB

Posted on 1998-06-01
8
185 Views
Last Modified: 2010-05-03
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
Comment
Question by:vmano
  • 4
  • 3
8 Comments
 
LVL 5

Accepted Solution

by:
bin_huwairib earned 50 total points
ID: 1462241
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
 
LVL 3

Author Comment

by:vmano
ID: 1462242
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
 
LVL 5

Expert Comment

by:bin_huwairib
ID: 1462243
How it is not working? do you get any error message? please explain more.

Bin Huwairib
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 3

Author Comment

by:vmano
ID: 1462244
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
 
LVL 3

Author Comment

by:vmano
ID: 1462245
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
 
LVL 5

Expert Comment

by:bin_huwairib
ID: 1462246
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
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1462247
Bought This Question.
0
 
LVL 3

Author Comment

by:vmano
ID: 1462248
MirkWood,
What is this all about "BUYING"? Can you tell me more about this buying questions?

vmano
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question