I've been trying to obtain the email header from messages in Outlook using VBA. I have done some investigation and found that in outlook they are stored separately and require use of the CDO library to get hold of the header. So, I used Tools-Reference to enable the CDO Win 2000 library, cdosys.dll and employed the code below - but on compiling in the Outlook VBA Editor it gives me errors in all references to that CDO library. Can anyone assist here? Many thanks
Public Function InternetHeaders() As String <br />
Dim objOutlook As Outlook.Application <br />
Dim objItem As Outlook.MailItem <br />
Dim objCDO As MAPI.Session <br />
Dim objMessage As MAPI.Message <br />
Dim objFields As MAPI.Fields <br />
Dim strID As String <br />
Const CdoPR_TRANSPORT_MESSAGE_HEADERS = &H7D001E <br />
On Error Resume Next <br />
' Instantiate an Outlook Application object.<br />
Set objOutlook = CreateObject("Outlook.Application") <br />
'Find the current email item and get its EntryID<br />
Set objItem = objOutlook.ActiveInspector.CurrentItem <br />
strID = objItem.EntryID <br />
'Then set up a CDO Session using a piggy-back login<br />
Set objCDO = CreateObject("MAPI.Session") <br />
objCDO.Logon "", "", False, False <br />
'Now get the item as a CDO Message<br />
Set objMessage = objCDO.GetMessage(strID) <br />
'Now get the headers from the message<br />
Set objFields = objMessage.Fields <br />
InternetHeaders = objFields.Item(CdoPR_TRANSPORT_MESSAGE_HEADERS).Value <br />
'Now that the headers are captured in a string you can do whatever you want with them<br />
objCDO.Logoff <br />
Set objFields = Nothing <br />
Set objMessage = Nothing <br />
Set objCDO = Nothing <br />
Set objItem = Nothing <br />
Set objOutlook = Nothing <br />
End Function <br />
Normally, if I hear display Image randomly in asp.net, I think of an AdRotator. If you set up one of your columns in the datagrid as a template you should be able to add the adRotator control to it. I guess I am assuming you are working with Visual studio 2005 ASP.net 2.0. I don't think that control exists in VS 2003. Anyway, I hope that helps.
I m doing right now somewhat same like you.
So i insert one more section in footer & have place my subreport there.
Now it looks fine but I dnt whether this is a good way. ...for time being it is ok.
If you get some other idea please let me know.
My mail id ->email@example.com
Is the creation of connection object on every call of funtion in web service can decrease the process response (because the scope is local)?
what is consequencess if I put the connection object in module with Friend declaration?
So simple ,
jst refer all controls name by using relative formname.
if your main form's name is "MainForm" & the form having datagrid where you r going to take records, its name is "RecordForm".
refer datagrid by that form's name
suppose u hav to fill one value from datagrid's 1st col & 1st row in textbox present on MainForm then write-> textbox1.text= RecordForm.datagrid.item(1,1).value.
thank you for your help. It is going good. I am almost done with my application except the one that I am asking.
yes. all the fields are textboxes on the main form. I am getting this error when I click on the one of the datagrid cells.
Unable to cast object of type 'System.String' to type 'System.Windows.Forms.TextBox'.
here is my code:
Private Sub FSSCallerRecordsDataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles FSSCallerRecordsDataGridView.CellContentClick