|
Leonardo:
To save a message to a specific folder you would use the following code:
oMsg.SaveAs("C:\FolderName\Message.msg")
To save a message to the Drafts folder of outlook:
oMsg.Save()
Hope this helps..
:::EDIT:::
Also, using the Intellisense and Object Explorer features of VStudio will answer a lot of your own questions.
Intellisense will show you all available and exposed methods, properties and functions for objects.
Object Explorer will give you a full rundown of the methods, properties and functions within a class.
Daniel Rolfe
-------------
Software Engineer
VB, ASP.NET, ASP, PHP, SQL Server 2005, SQL Server 2008
|
|
|
|
|
Thank you, but this isn't what was I looking for.
I'm able to save a message, but I must understand if the user press SEND or CANCEL the email.
I have to do so, because VB2005 open Outlook with a new mail with subjecy and body filled. But I need that the user can modify the body or the recipients.
Finally, if the user send the mail I need to save it, otherwise nothing happen.
Can somebody haelp me?
Regards
Leonardo
|
|
|
|
|
Good Day All
I once created a controller in Visual Studio for a C# project.
This controller included CheckBox, two TextBoxes, and a NumericUpAndDown, all in one sort-of "dataGridView-type" controller.
I am struggling to replicate this result in any way.
I want to all these controllers within the GridView, having a Header row for the labels, as with any of data from a database for a GridView.
I am not sure if creating a GridView and inserting these controllers into each cell would work, but my attempts thus far have lacked any outcome.
Could someone please assist as to how to go about this, and whether or not what I am doing is in fact on the right track?
Thanks in Advance
|
|
|
|
|
I assume you meant: I have a created a user control and want to add it as a column to the datagridview.
If I am right, then your user control class should inherit from the DataGridViewColumn class. That way you can add you control as a column of the DataGridView . Read this[^].
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Hey There
Yes, you were right in your assumption.
Thanks a million for the help!
Its a tricky bit of code to have written from scratch, but simple to implement from here.
Thanks Again!
|
|
|
|
|
Hi all,
Thanks to all those who have replied to my posts earlier.
I want to add a new icon in the MessageBoxIcon list.
Is it possible? If possible how to accomplish it.
Thanks in advance.
|
|
|
|
|
No, it is not. You would need to create your own dialog class to do that.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks a lot for the information.
Will try to create my own dialog.
|
|
|
|
|
|
Hi guys, i need help. Below i c/p code, to explain in short, in abstract class i have login authentication, i inherit that abstarct class on all other classes that i need to be secured, now what i wan tis that if my abstract class does invalidate user, to be stoped and render login page, otherwise it will continue processing and on end render index page.
Public Class Secure
Public Sub New()
If Not User.Authenticated Then
RenderLogin()
End If
End Sub
End Class
Public Class Index
Inherits Secure
Public Sub New()
LoadMessages()
LoadTasks()
RenderIndex()
End Sub
End Class
The question is, how do i stop further executing after RenderLogin() method? I don't want it to continue constructing new Index class. Btw, all this is run inside http context, but i did put it in here and not in asp.net since this has more got to do with VB and classes than with asp. Oh, and i know i can write Response.End, but i would like to avoid this - because of "System.Threading.ThreadAbortException" errors which go on my nerves.
|
|
|
|
|
There is no way to stop a constructor from working except perhaps for throwing an exception. A better design would be to set a flag, so that you can check the flag from the client class to see if login succeeded.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I was afraid of this
This would mean that i have to check for this flag on like 150 classes
This sucks.
|
|
|
|
|
It means the overall design is flawed.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Do you maybe have an idea how could i create it right way.
I will wrote in short what i try to make, and if you have time, maybe you could give me an example how would be best to make.
I have a bunch of classes, like UserEdit, UserList, TaskEdit, TaskList, each of this class has some of it's methods, like UserEdit has Add, Update, View and Delete.
Each of this class and method has a restriction based on user, so a specific user can use method Add in class UserEdit. So, to avoid check on each class, how could i make this check in abstract class?
I know that best would be to have this check in children (class that inherits abstract class) and on method level, but that is a lot of work to implement in each class.
So, do you have any idea?
Also, UserEdit might have Add method, but TaskEdit does not neccessery have one.
|
|
|
|
|
I don't see a way to avoid modifying all of the child classes, but do it right, and you'll only need to do it once.
1) Make an overridable/virtual Initialize() method in the base class
2) Move all of the construction code in the child classes into the Initialize() override.
3) In the base constructor, either call the Initialize() method or don't.
Obviously, you don't have to call it Initialize()... Whatever name is more suitable.
|
|
|
|
|
OK, sounds good. Thank you.
|
|
|
|
|
Hi to all, am new with VB.net an need help with events handling.
From the following code, How can I identify which of the two event was triggered. Is this possible?
Private Sub BHDay_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BHDay.TextChanged, BHDay.LostFocus
Some Validation Code...
End Sub
Thanks,
|
|
|
|
|
There's no way to tell which event triggered the handler using this code.
A better method would be to break this into two seperate handlers.
Private Sub BHDay_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BHDay.TextChanged
' Code to handle specific case of TextChanged
' Then call CommonCode to execute code that should run if either event is triggered.
End Sub
Private Sub BHDay_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BHDay.LostFocus
' Code to handle specific case of LostFocus
' Then call CommonCode to execute code that should run if either event is triggered.
End Sub
Private Sub CommonCode()
End Sub
|
|
|
|
|
Abit stuck at the moment
I need some help all i need to do is to copy the content of a.txt into b.txt?
i don't really know where to start, so if anybody can help that would be great
Cheers
Dan
|
|
|
|
|
Like d@nisch explained[^], check out the System.IO namespace. The method CopyTo [^] does what you're looking for - it copies the contents of file A into file B.
I are Troll
|
|
|
|
|
Dim contents As String = My.Computer.FileSystem.ReadAllText("a.txt")
My.Computer.FileSystem.WriteAllText("b.txt", contents, False)
|
|
|
|
|
This is the third time you've asked this. The second time was only a few hours before this time. Perhaps you should continue to reply on the older thread, when it's still visible ? Perhaps when you decide you need to ask again, you should explain what you were told before, what you tried, and why you're still stuck ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
This is the code:
With Adodc1.Recordset
.MoveFirst()
Do While .EOF = False
Debug.Print(.Fields("Name").Value)
.MoveNext()
Loop
End With
The problem: Adodc1.Recordset.Eof is never set to False thus the loop never ends. Is this a bug in VB or is there some option/parameter that I'm not using?
|
|
|
|
|
If you are using VB Express 2008, why are you still using RecordSet?
Shouldn't you be trying to move this to DataSet?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks for your reply. Use of Datasets is another topic. The VB Express documentation clearly states "You can use the BOF and EOF properties to determine whether an Recordset object contains rows or whether you have gone beyond the limits of an Recordset as you move from row to row."
|
|
|
|