|
<pre>
Hello ...
Problem :
problem regarding sending mail through CDO using Excel macro
For some attempts i sucussful sent mails with attachment but suddenly it droped. I dont know what was the problem but I think none of the errors were observed during the process.
More over I am not able to find mail in my inbox to which i had configured in the macro.
My system configuration is - Win XP Sp3 o/s &amp; working on Office 2003
Excel VBA Code is as follows....
Option Explicit
Private Sub CommandButton1_Click()
Dim objMsg As Object
Dim objConf As Object
Dim objFlds As Object
Dim strBody As String
Const cdoSendUsingPickup = 1
Const cdoSendUsingPort = 2 'Must use this to use Delivery Notification
Const cdoAnonymous = 0
Const cdoBasic = 1 ' clear text
Const cdoNTLM = 2 'NTLM
'Delivery Status Notifications
Const cdoDSNDefault = 0 'None
Const cdoDSNNever = 1 'None
Const cdoDSNFailure = 2 'Failure
Const cdoDSNSuccess = 4 'Success
Const cdoDSNDelay = 8 'Delay
Const cdoDSNSuccessFailOrDelay = 14 'Success, failure or delay
Set objMsg = CreateObject("CDO.Message")
Set objConf = CreateObject("CDO.Configuration")
objConf.Load -1
Set objFlds = objConf.Fields
With objFlds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = 587 '465
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "mailserver4macro@gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "jose309930"
.Update
End With
strBody = "This is a sample message." & vbCrLf
strBody = strBody & "It was sent using CDO." & vbCrLf
With objMsg
Set .Configuration = objConf
.To = "hai_jimson_jose@yahoo.com"
.From = "mailserver4macro@gmail.com"
.Subject = "Hai jimson!! This is a CDO test message"
.TextBody = strBody
'use .HTMLBody to send HTML email.
'.Addattachment "c:\temp\Scripty.zip"
.Fields("urn:schemas:mailheader:disposition-notification-to") = "mailserver4macro@gmail.com"
.Fields("urn:schemas:mailheader:return-receipt-to") = "mailserver4macro@gmail.com"
.DSNOptions = cdoDSNSuccessFailOrDelay
'.Fields.Update
.Send
End With
End Sub
</pre>
|
|
|
|
|
|
Hello everybody,
I hope someone can help me with a weird kind of home-made newbie problem...
I've been trying around with different solutions to create Outlook-Add-Ins (with VB Express only), which lead to installing various samples and testing them. Some had to be registered manually, with *.reg files as well as with regsvr32, others with regasm. Having found a way that works for my purpose, I tried to go back to my clean Outlook and found that I must have missed to uninstall any of the samples - Outlook shows a custom "MyBar" command with a "My Button" commandbutton, and I'm just unable to trace its origin .
Resetting the standard bar in Outlook doesn't help, the custom bar is installed at each startup. And searching the registry didn't lead to any new insights since the different ...\outlook\AddIns keys seem to be all empty already. Also, there is no relevant reference or add-in listed in Outlook.
Does anyone of you know how I can find out where that button came from? From where would Outlook load that UOO (= unidentified outlook object )?
Thank you in advance,
Michael
|
|
|
|
|
In Outlook 2003, and I think 2007, it's under Tools -> Trust Center -> Add-ins tab.
|
|
|
|
|
Hi Dave,
unfortunately I'm using Outlook XP in German... but I guess what you mean would be Tools --> Options --> Extended --> COM Add-Ins, where I had expected to find the path to a dll myself. But too sad: There's nothing there as well as in the References and Add-Ins of the VBIDE.
Meanwhile I found the responsible sample project, and it's an OLDER Microsoft KB sample written in C++:
COMADDIN.EXE (http://support.microsoft.com/download/support/mslfiles/COMADDIN.EXE)
Having no clue about C++ I obviously managed to compile the code (more or less by chance), and I'm afraid the sample produced any registry (or other?) system entries which outlook happens to load without showing it as an add-in... Maybe it's also important that the sample was made for OL2000.
Are you able to read C++ and have a look at the sample? I'm still optimistic that there must be a way to remove the "MyBar", but the task is just far beyond my limits
Hoping for your help,
sincerely
Michael
|
|
|
|
|
You might want to try the C++ forum for that.
|
|
|
|
|
Hi All,
How Can I Create digital sign for my application?
Need help.
Thanks
If you can think then I Can.
|
|
|
|
|
What do you mean ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
In vista Microsoft Defender shows my application is shows
Digitally Signed By: NOT SIGNED
Microsoft application shows it
Digitally Signed By: Microsoft Windows Verification PCA
so how to set digital sign for my application.
If you can think then I Can.
|
|
|
|
|
You have to purchase a certificate from a third party company. Try googling Thawte or Verisign and taking a look at their websites. They have a lot more information on the topic.
|
|
|
|
|
I am trying to built the certificate for my softwares. Not Certified by Verisign or Microsoft CA etc.
We are developer pls give me the way for developing that.
Thanks
If you can think then I Can.
|
|
|
|
|
You have to purchase a digital signature from a certificate authority such as Verisign or Microsoft CA. You cannot develop it in-house if you want it to be certified by Microsoft. This is good; if virus-writers could do this, they could masquerade as a Microsoft-certified application. They would be trusted by users and allowed to run all over the system
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Thanks for Help.
If you can think then I Can.
|
|
|
|
|
Hello everyone!
If we change the language from Regional Settings of Windows XP. Most specifically changing "preferred language" under standards & formats tab of Regional Settings dialog.
Now tell whether VB6.0 uses the same "User Default Locale ID" language for running applications using IDE? As When I run my application from Visual Studio 6.0 I get results in User Default Locale ID language or preferred language (as stated in first paragraph above). But after creating EXE of the application I get System Default UI Language.
Please tell me the standard rule VB6.0 uses.
Thanks.
Be Happy.
modified on Wednesday, June 3, 2009 2:43 AM
|
|
|
|
|
hi
i am using microsoft office (old version) excel visual basic editor.
currently i am stuck as i am trying to change the events of my form.
like form load, (top right corner of the form) close button and such
does anyone know how this can be done>?
as i understand in visual studio and such it is possible.
|
|
|
|
|
You cannot change the events inside Office. You just have to use what's exposed and understand that there is vast differences between Form events in a VB6 or VB.NET app and the events you find for UserForms in Office.
|
|
|
|
|
is there a way to disable it then? or attach an additional event to the close button?
|
|
|
|
|
Disable the close button?? Nope. You just have to be very clever in the way you handle the form being closed.
|
|
|
|
|
I have to fix a defect raised for an old legacy VB6.0 application. I am seeing really weird behavior when subtracting two double values.
I have two double variables. d = 2.3434543434E+15 and d1 = 2.3434543434E+15 . Both have same values. Weird thing is, d1 - d gives me 2 instead of 0! Just to see where I am going wrong, I ported this piece of code to C# and everything worked fine there. If I do d1 / d , I am getting 1 in VB which is correct. But what's wrong with the subtraction?
Any ideas?
|
|
|
|
|
Hi,
there most likely is nothing wrong. Have a look here[^].
It is inherent to floating-point numbers: they trade some accuracy for a much larger range.
A floating-point number stores a mantissa, an exponent and a sign.
the exponent indicates a power of 2, not 10, and uses anywhere between 8 and 16 bits.
the mantissa indicates a magnitude in a limited range, say in [0.5, 1) and uses some 23 to 50 bits
(details vary from one CPU family to the next, IEEE did some standardization attempts, not relevant here).
You have chosen to show the number as d = 2.3434543434E+15, now why didn't you chose d = 2.343454343411111111111E+15? I added some ones to emphasize that you stopped the representation hoping the decimal digits shown, exactly correspond to the binary bits present in the mantissa, which will not be true in general.
So one number could be 2.343454343411116E+15 whereas the other could be 2.343454343411114E+15 (I truncated where the decimal point would be when looking at integer values). So now the difference is exactly 2, whereas the quotient is 1 + epsilon, epsilon being a very small number (around 1/1.17E15);
a double would be able to hold epsilon very accurately, however 1+epsilon would not be discernible from 1.
It is a well known fact in numeric analysis subtracting two large and similar numbers increases the relative errors. Example: if you want to measure the thickness of a wall, you could measure the wall-to-wall distance of a room on the inside, do the same on the outside, and subtract. If you make a 1% error on those dimensions, your calculated wall thickness could be off by 10% or more.
If you want to see the details, try to have a look at the bit patterns used by d1 and d2; in .NET BitConverter.GetBytes() would give you access to them, I don't recall if and how it could be done in ancient VB.
A much simpler example illustrating the same principles would be to calculate 1/3 or 1/7, then multiplying again by 3 or 7; the result will not always be 1!
PS: the above is true in many/all programming languages; some do offer extra data types (such as decimal) to get yet another trade of of accuracy and range.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
You really ARE the man, Luc! I very much enjoy reading your responses...
|
|
|
|
|
Ditto to that! Almost like Luc knew something about big numbers
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
big numbers don't fit in a double.
I have been busy creating my own BigInteger library, where arbitrary length integers can be stored and operated upon. Got somewhat stuck on efficient division and square rooting, and now .NET 4.0 is finally offering such class.
FWIW: we humans don't know any big number; whatever number we come up with, it is always part of a really tiny miniscule fraction of the numeric universe, almost all existing numbers happen to be larger... and less popular.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks Luc. That was a mind blowing answer. A well deserved 5.
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|