|
Hello,
Last time i had posted a query & now i'm answering it. We dont need to specify smtp server name if our Outlook is already configured. But i am getting a problem. How should we access the email id of perticular person from database & send mail only to that email id with which our query matches,
Example : "Select emailid from emptable where empid = '1' "
The below code is running fine when i give fixed address for m.To=manoj.jahagirdhar@hp.com
But i'm unable to access email id from database. Kindly help me!!
Below is the code which is working fine for fixed email id
Dim m As New MailMessage
m.To = "manoj.jahagirdhar@hp.com"
m.From = "manoj.jahagirdhar@hp.com"
m.Subject = "Congrats!!Your Account Is Created. Collect Password from your mail"
m.BodyFormat = MailFormat.Html
m.Priority = MailPriority.High
m.Body = "Your Login ID is '" & TextBox1.Text & "' & Your Account Password Is '" & Password & "'"
SmtpMail.Send(m)
|
|
|
|
|
Question is not that clear. From what i understood, i think query is returning the email id, and giving that email id to the m.To should send the email. If it is giving error, can u tell me what is the error it is showing?
Het Waghela
Be Humble in Victory and Strong in Defeat.
Het Waghela, Blog|Het Waghela DotNet Questions Link|More Links
|
|
|
|
|
Im doing accounting financial report and it involves vertical arrangement of the report design.
let say i put this in my page header section as title:
[Assets]
Then i need to get all assets name from database and for this i use group section to display it ( is it page header cant do this? auto added if there is more record).
Then i want to put the next title
[Expenses]
I need to put that expenses title as like in page header but the position of this expenses must below after asset title and the collection of assets.
Then expenses collection have many different types of expense and i want to display this into group section again and the position of this sure after expense title.
I can do this if i can 'add' page header after the group section OR after report footer but crystal report cannot do that.
How can i solve this?
|
|
|
|
|
Is it possible to populate a datagrid with an array and if so how is it done.
How can you add a new line to a Dataset that is used to populate a grid. i.e. inputted text field to be added to the datagrid without saving it to the database. The reason you want to view the details and if not happy then do not save input values
|
|
|
|
|
I remember in VB6 there are this boxes called Masked Boxes. Is this 'Masked Boxes' still available to use in vb.net? If so, where is it, I can't find it..
|
|
|
|
|
Its not available in dotnet. you need to manually add it as a com control
Jon
|
|
|
|
|
Thanz for replying me on this... Manually add it in COM control huh? Can u tell me how to add it in.. ?
|
|
|
|
|
|
Hmm, i couldn't get in www.codeproject.com/dotnet/activexnet.asp. Is this the correct link?
|
|
|
|
|
|
|
Umm, dun want to sound very stupid but, that link didn't actually tell me how to import the Masked Box ? Hehehe... Sorry for all the bother guys. I just recently migrated from VB6 and even in VB6 I was a very fresh beginner. So VB.net is a bit more complex and all. Hope you guys will bear with me at the moment with my weird questions.
|
|
|
|
|
Ok, its ok now. I got it. It is under Microsoft Masked Edit. Apparently my office dun have VB6 installed so I couldn't find it. Thanz for your help anyway you guys, you r great...
|
|
|
|
|
Not to be completely pedantic, but this goes especially if you are a beginner.
The language you use, and the ability to comprehend your question, goes a long way to being able to answer you and help you. Therefore, try to avoid words like "Thanz" for thanks and "dun" for don't. Native English speakers will not have much difficulty, but those that have english as a second/thrird/fourth language may well do.
|
|
|
|
|
I think there is one that someone made on this site. I know I have seen one somewhere..google it.
|
|
|
|
|
Ahh, found that masked Edit Box u mentioned using google. Thanz a bunch lespaul. U r great...
|
|
|
|
|
hi all
I could Run word by VB6...for example user open an exiting file and make some changes on content of that .doc file
when user close word u know this message appear : do u want to save the changes to "FileName.doc" ? yes/No ...now my problem:i want to control this user selected option (yes or no)in my program..i want to control that user click on yes or no? how can I take this control?
|
|
|
|
|
You cant really, but you dont actually need to.
All you need to do is code in the before close event to pop up your own message box then close word from code and suppress Words one from showing (this is an argument in the close method i think).
Try it yourself. If you have any problems i will try to get an example for you.
Jon
|
|
|
|
|
OK. A simple example for you. All it does is replace words save box with my own.
Private WithEvents oword As Word.Application<br />
Private WithEvents odoc As Word.Document<br />
Private Sub Command1_Click()<br />
<br />
Set oword = New Word.Application<br />
oword.Visible = True<br />
Set odoc = oword.Documents.Open("yourfile.doc")<br />
End Sub<br />
<br />
<br />
Private Sub oword_DocumentBeforeClose(ByVal Doc As Word.Document, Cancel As Boolean)<br />
<br />
If MsgBox("Do you want to save this file?", vbYesNo, "Save") = vbYes Then<br />
oword.Activate ' not required if oword is not visible<br />
odoc.Save<br />
oword.Documents.Close 'If using word 2000 or below i think you need the argument here to not save changes. That will suppress words messagebox but this works fine with word 2003<br />
<br />
oword.Quit<br />
Else<br />
oword.Activate<br />
oword.Documents.Close<br />
oword.Quit<br />
End If<br />
<br />
Set odoc = Nothing<br />
Set oword = Nothing<br />
End Sub
|
|
|
|
|
|
hi all
I could Run word by VB6...for example user open an exiting file and make some changes on content of that .doc file
when user close word u know this message appear : do u want to change to "file name.doc" ? yes/No ...now my problem:i want to control this user selected option (yes or no)in my program..i want to control that user click on yes or no? how can I take this control?
|
|
|
|
|
Hi, forum
My application uses MS word 2000 in it, it is used to read the wordfiles and get its content, while reading if the word file is corrupt, the objects throws and error
i am using a error handler to do this, and each time the routine gets stuck in the error i get the
switch to retry message box where in a new instance of word is initiated
and here exactly lies the problem, if i click 20 time on switch 20 instances
of word application are created and i can see 20 winword.exe in the task manager this is some thing annoying to me.
please tell me how do i eliminate this chaos.
If err.Number = -2147023170 Then
Set m_WordServer = Nothing
Set m_WordServer = New Word.Application
ElseIf err.Number = 462 Or err.Number = 429 Then
Set m_WordServer = Nothing
Set m_WordServer = New Word.Application
ElseIf err.Number = -2147417851 Then
Set m_WordServer = Nothing
Set m_WordServer = New Word.Application
ElseIf err.Number = -2147418111 Then
Set m_WordServer = Nothing
Set m_WordServer = New Word.Application
Else
Set m_WordServer = Nothing
Set m_WordServer = New Word.Application
End If
err.Clear
|
|
|
|
|
Automation can be a pig if it starts to go wrong because your app will not know the error, it just knows there is an error and needs to know what to do with it. At the same time word wants you to deal with the error that its generated. If your word application instance is not visible the problems are multiplied because you cannot do anything with it.
You could try the following on any error in the routine that handles word
m_Wordserver.active
m_Wordserver.quit
set m_Wordserver=nothing
It may help
jon
|
|
|
|
|
Need a little guidance here..
Lets say I make a new project with two forms in it, namely Form1 and Form2.
Form1 is the main form and when I run my program, this is the form that comes up. In it, I make a button and upon pressing a button, it calls up form2. Here is the Command I use.
Dim frmCall as New Form2
frmCall.show()
when I go to form2, I create a button to close this form2 and goes back to form1. And the command in it I use is
Me.Dispose()
My problem is, what command do I put into this button in Form2 to call Form1 Back out.. Any help offered will be greatly appreciated.
|
|
|
|
|
Oops, sorry, I put in this command in the button in Form1.
Dim frmCall as New Form2
Me.Hide() ' To hide Form1 from View
frmCall.show()
So basically, what the button in form2 should do is, close Form2 and bring Form1 back to focus... Any help offered will be greatly appreciated.
|
|
|
|