|
Hi,
I'm using MAPISession and MAPIMessage components to access MS Outlook emails but the "Fetch" does not retrieve any read emails.
The code I have is as follows:
...
MAPISession1.Username = "Outlook"
MAPIMessage1.DownloadMail = True
MAPISession1.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.Fetch
iNumOfMsgs = MAPIMEssages1.MsgCount 'iNumOfMsgs declared as a local var
...
iNumOfMsgs returns 0 when there are 100 read emails
Any help with this is very much appreciated
|
|
|
|
|
Hi,
If I have text like:
VariantDisplayMode
How do I break it up so that it displays as:
Variant Display Mode?
Basically it is a seperation at the capital letters.
Regards
ma se
|
|
|
|
|
Use the Regex class with a regular expression pattern like "([a-z])([A-Z])" to find the changes from lower case to upper case. Put a space between them by replacing the occurances using the pattern "$1 $2".
---
single minded; short sighted; long gone;
|
|
|
|
|
Guffa, I think that regular expression would fail to properly parse something like "ThisIsATest" because it wouldn't pick up on two capital letters next to one another. I think something like this would be required to find the word boundaries "([A-Z]|[a-z])(?=[A-Z])". Using a replace of "$1 ".
|
|
|
|
|
That's a good point. I didn't think of the special case of single letter words.
---
single minded; short sighted; long gone;
|
|
|
|
|
Another way would be to :
-Create a character Array of your text using ToCharArray()
-Test each character , if Caps add space before the character and add it to the resulting string otherwise add the character to the resulting string:
<code>
Private Function TransFormText(ByVal oText As String) As String
Dim oResult As String = ""
Dim oArray() As Char = oText.ToCharArray()
For Each oItem As Char In oArray
If oItem. = oItem Then
oResult = oResult & " " & oItem
Else
oResult = oResult & oItem
End If
Next
Return Trim(oResult)
End Function
</code>
|
|
|
|
|
You should however mention that the method scales very badly, so it's only suitable for very short strings.
For a string with 20 characters, it creates 40 string objects to produce the result. Also, for every additional character the memory usage doubles.
---
single minded; short sighted; long gone;
|
|
|
|
|
Guffa wrote: You should however mention that the method scales very badly, so it's only suitable for very short strings.
For a string with 20 characters, it creates 40 string objects to produce the result. Also, for every additional character the memory usage doubles.
sure, But its a good starter.Obviously the poster is a beginner and in such cases its better to provide a solution that is easy to understand and that build up logic...
|
|
|
|
|
Well, at least it increases the traffic to the site when he comes back wondering why the code is getting so f... ehm... extremely slow.
---
single minded; short sighted; long gone;
|
|
|
|
|
There was an error in my previous post:
<code>
Private Function TransFormText(ByVal oText As String) As String
Dim oResult As String = ""
Dim oArray() As Char = oText.ToCharArray()
For Each oItem As Char In oArray
If Char.ToUpper(oItem) = oItem Then
oResult = oResult & " " & oItem
Else
oResult = oResult & oItem
End If
Next
Return Trim(oResult)
End Function
</code>
|
|
|
|
|
I have a couple questions about writing a text file (Most of it know as I've been writing files in this application for quite some time now) but the real question I have is this: I am changing my error log text file to a comma delimited file. The first line with be my headers (Error, Message, Stack Trace, Date/Time) how do I go about only writing this line a single time, then go about adding any errors that may happen below it
"Well yes, it is an Integer, but it's a metrosexual Integer. For all we know, under all that hair gel it could be a Boolean."
Tom Welch
|
|
|
|
|
Write the headers when you create the file :
If Not File exists Then
' Create Log File
'Write Header
Else
' Write Log Row
End If
|
|
|
|
|
Hi, to all.
Mine question is : can i use SQL commands about selecting, sorting and filtering data in VB.Net on DataTables...and which of them can i use
Especially CASE...WHEN...ELSE..END
|
|
|
|
|
Not reall sure what you are wanting to know...You can use ADO.NET to select table from a database using SQL commands if that is what you are talking about?
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
|
|
|
|
|
You can not use select insert update statements on datatables, rather you can filter your datatable with DataTable.Select(filterexpression as String) method, where filterexpression is like Dept='Administration'.
These filter expression is just like Where clause of Select statements.
Be a part of solution, rather then be a part of problem
|
|
|
|
|
Yes, i was trying to use case.. then .. else .. end statment like in sql in where clause, but i did not make it. Just filtering.
I have some information that there is driver, i guess,thru it is possible to use most of sql statments in vb on datatables. Thank you anyway
|
|
|
|
|
i want to open form2 from menu strip button
Menustrip buttons name is "Preference"
Other button is Exit by which i want to close the application
i want to know its coding plz help me ( (
|
|
|
|
|
to open new form:
dim frmTemp as new Form2
frmTemp.show
to close the application:
Application.Exit()
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
thanx
now i want to make FTP browser
there is no such a option in toolbox
plz help me
|
|
|
|
|
|
|
but where i have to copy & paste these codes??
i had already created design (
|
|
|
|
|
Hello,
i've found a code on this page :http://weblogs.asp.net/kennykerr/archive/2006/08/10/Windows-Vista-for-Developers-_1320_-Part-3-_1320_-The-Desktop-Window-Manager.aspx[^] there's described how to make glass effect, without the known problems with the black controls in the window. But the problem is, the code is written in VC++ and i can't VC++ =(.
How can i do the same in VB.NET?? I've tested a lot, but it doesn't work easyly.
Here's my Code:
Public Class Form1<br />
<Runtime.InteropServices.DllImport("dwmapi.dll", CharSet:=CharSet.Auto)> _<br />
Public Shared Sub DwmExtendFrameIntoClientArea(ByVal hWnd As System.IntPtr, ByRef pMargins As Margins)<br />
End Sub<br />
<br />
<Runtime.InteropServices.DllImport("dwmapi.dll", CharSet:=CharSet.Auto)> _<br />
Public Shared Sub DwmIsCompositionEnabled(ByRef IsIt As Boolean)<br />
End Sub<br />
<System.Runtime.InteropServices.DllImport("user32.dll")> _<br />
Private Shared Function SetLayeredWindowAttributes(ByVal hWnd As IntPtr, ByVal crKey As Int32, ByVal bAlpha As Byte, ByVal dwFlags As Int32) As Boolean<br />
End Function<br />
<br />
Const COLORREF As Int32 = -65281<br />
Const LWA_COLORKEY As Int32 = 1<br />
<br />
Public Structure Margins<br />
Public Left As Integer<br />
Public Right As Integer<br />
Public Top As Integer<br />
Public Bottom As Integer<br />
End Structure<br />
Private inset As Margins = New Margins<br />
<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
<br />
Me.BackColor = Color.FromArgb(COLORREF)<br />
'Me.TransparencyKey = Color.FromArgb(COLORREF)<br />
<br />
SetLayeredWindowAttributes(Me.Handle, COLORREF, 80, LWA_COLORKEY)<br />
Dim marg As New Margins<br />
marg.Bottom = -1<br />
marg.Left = -1<br />
marg.Top = -1<br />
marg.Right = -1<br />
<br />
DwmExtendFrameIntoClientArea(Me.Handle, marg)<br />
<br />
End Sub<br />
End Class
Another code, which do the same and is written in C# i've found on this site: http://weblogs.asp.net/kennykerr/archive/2007/01/23/controls-and-the-desktop-window-manager.aspx[^]
Has somebody any ideas how to do this???
Thanks for your help =)
|
|
|
|
|
Are you still having trouble with this?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
how do i can create my own new component in toolbox n how to make other project in the same solution explorer can recognise my new component
|
|
|
|