473,325 Members | 2,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Problem with email generated from VB.NET using Outlook

Siv
Hi,
A little while ago I asked if anyone could help me with how to create an
email using MS Outlook that contained an embedded picture file.
Thanks to Jay Harlow I was able to get this working using a code example
from http://www.outlookcode.com/d/code/htmlimg.htm that details the
procedure and with a bit of tweaking I managed to get it working really
well.

I now find that there is a new user on a laptop that always gets an error at
the point where the code creates an Outlook object. I have included all the
interop DLLs with the application and for all users, the code works, except
this one.

The code snippet that is having the problem is:

' Outlook objects
Dim objApp as Outlook.Application
Dim l_Msg As MailItem
Dim colAttach As Outlook.Attachments
Dim l_Attach As Outlook.Attachment
Dim oSession As MAPI.Session

' CDO objects
Dim oMsg As MAPI.Message
Dim oAttachs As MAPI.Attachments
Dim oAttach As MAPI.Attachment
Dim colFields As MAPI.Fields
Dim oField As MAPI.Field

Dim strEntryID As String

' create new Outlook MailItem
Set objApp = CreateObject("Outlook.Application","") '<== PROBLEM OCCURS
HERE!!
Set l_Msg = objApp.CreateItem(olMailItem)
' add graphic as attachment to Outlook message
' change path to graphic as needed
Set colAttach = l_Msg.Attachments
Set l_Attach = colAttach.Add("c:\test\graphic.jpg")
l_Msg.Close olSave
strEntryID = l_Msg.EntryID
Set l_Msg = Nothing
etc ...

The user has the same DLLs installed in the application folder as all the
other users, the difference is that they all had MS Office 2000 and then
upgraded to Outlook 2003 as part of the Small Business Server 2003
installation, where the new user only ever had Outlook 2003.

I am using the following DLLs:
===============================
DLL Version
Interop.MAPI.dll 1.21.0.0
Interop.Microsoft.Office.Core.dll 2.3.0.0
Interop.Outlook.dll 9.2.0.0
================================

Can anyone explain why the CreateObject command is failing on that one
machine? It's driving me nuts!

--
Siv
Martley, Near Worcester, UK.
Nov 21 '05 #1
5 3894
I have read that the script blockers in Antivirus programs may block calls
to CreateObject("Outlook.Applicat*ion"). I know Norton Antivirus has such a
script blocker, for example. I did a quick Google search on
CreateObject("Outlook.Applicat*ion") and antivirus that produced some
interesting messages.

Perhaps that is the problem.
"Siv" <ms**********@removeme.sivill.com> wrote in message
news:e%***************@TK2MSFTNGP11.phx.gbl...
Hi,
A little while ago I asked if anyone could help me with how to create an
email using MS Outlook that contained an embedded picture file.
Thanks to Jay Harlow I was able to get this working using a code example
from http://www.outlookcode.com/d/code/htmlimg.htm that details the
procedure and with a bit of tweaking I managed to get it working really
well.

I now find that there is a new user on a laptop that always gets an error
at the point where the code creates an Outlook object. I have included
all the interop DLLs with the application and for all users, the code
works, except this one.

The code snippet that is having the problem is:

' Outlook objects
Dim objApp as Outlook.Application
Dim l_Msg As MailItem
Dim colAttach As Outlook.Attachments
Dim l_Attach As Outlook.Attachment
Dim oSession As MAPI.Session

' CDO objects
Dim oMsg As MAPI.Message
Dim oAttachs As MAPI.Attachments
Dim oAttach As MAPI.Attachment
Dim colFields As MAPI.Fields
Dim oField As MAPI.Field

Dim strEntryID As String

' create new Outlook MailItem
Set objApp = CreateObject("Outlook.Application","") '<== PROBLEM OCCURS
HERE!!
Set l_Msg = objApp.CreateItem(olMailItem)
' add graphic as attachment to Outlook message
' change path to graphic as needed
Set colAttach = l_Msg.Attachments
Set l_Attach = colAttach.Add("c:\test\graphic.jpg")
l_Msg.Close olSave
strEntryID = l_Msg.EntryID
Set l_Msg = Nothing
etc ...

The user has the same DLLs installed in the application folder as all the
other users, the difference is that they all had MS Office 2000 and then
upgraded to Outlook 2003 as part of the Small Business Server 2003
installation, where the new user only ever had Outlook 2003.

I am using the following DLLs:
===============================
DLL Version
Interop.MAPI.dll 1.21.0.0
Interop.Microsoft.Office.Core.dll 2.3.0.0
Interop.Outlook.dll 9.2.0.0
================================

Can anyone explain why the CreateObject command is failing on that one
machine? It's driving me nuts!

--
Siv
Martley, Near Worcester, UK.

Nov 21 '05 #2
Siv
William,
That's something I wouldn't have thought of. The user has McAfee antivirus
on her machine, and the other users have Sophos Antivirus, she also runs MS
Antispyware beta which they don't either as the Sophos suite we have
installed on the desktop machines covers both antivirus and spyware threats.

Have you heard that McAfee does this??

Is it just the script blocking part or some other aspect of McAfee?

Thanks for your help, it gives me an avenue to pursue.
--
Siv
Martley, Near Worcester, UK.
"William LaMartin" <la******@tampabay.rr.com> wrote in message
news:eq***************@TK2MSFTNGP14.phx.gbl...
I have read that the script blockers in Antivirus programs may block calls
to CreateObject("Outlook.Applicat*ion"). I know Norton Antivirus has such
a script blocker, for example. I did a quick Google search on
CreateObject("Outlook.Applicat*ion") and antivirus that produced some
interesting messages.

Perhaps that is the problem.
"Siv" <ms**********@removeme.sivill.com> wrote in message
news:e%***************@TK2MSFTNGP11.phx.gbl...
Hi,
A little while ago I asked if anyone could help me with how to create an
email using MS Outlook that contained an embedded picture file.
Thanks to Jay Harlow I was able to get this working using a code example
from http://www.outlookcode.com/d/code/htmlimg.htm that details the
procedure and with a bit of tweaking I managed to get it working really
well.

I now find that there is a new user on a laptop that always gets an error
at the point where the code creates an Outlook object. I have included
all the interop DLLs with the application and for all users, the code
works, except this one.

The code snippet that is having the problem is:

' Outlook objects
Dim objApp as Outlook.Application
Dim l_Msg As MailItem
Dim colAttach As Outlook.Attachments
Dim l_Attach As Outlook.Attachment
Dim oSession As MAPI.Session

' CDO objects
Dim oMsg As MAPI.Message
Dim oAttachs As MAPI.Attachments
Dim oAttach As MAPI.Attachment
Dim colFields As MAPI.Fields
Dim oField As MAPI.Field

Dim strEntryID As String

' create new Outlook MailItem
Set objApp = CreateObject("Outlook.Application","") '<== PROBLEM OCCURS
HERE!!
Set l_Msg = objApp.CreateItem(olMailItem)
' add graphic as attachment to Outlook message
' change path to graphic as needed
Set colAttach = l_Msg.Attachments
Set l_Attach = colAttach.Add("c:\test\graphic.jpg")
l_Msg.Close olSave
strEntryID = l_Msg.EntryID
Set l_Msg = Nothing
etc ...

The user has the same DLLs installed in the application folder as all the
other users, the difference is that they all had MS Office 2000 and then
upgraded to Outlook 2003 as part of the Small Business Server 2003
installation, where the new user only ever had Outlook 2003.

I am using the following DLLs:
===============================
DLL Version
Interop.MAPI.dll 1.21.0.0
Interop.Microsoft.Office.Core.dll 2.3.0.0
Interop.Outlook.dll 9.2.0.0
================================

Can anyone explain why the CreateObject command is failing on that one
machine? It's driving me nuts!

--
Siv
Martley, Near Worcester, UK.


Nov 21 '05 #3
I haven't used McAfee in years. I am only familiar with Norton Antivirus.
I personally had to disable the script blocking in it to get various things
in Microsoft Word to work, possibly also to get Microsoft Document Imaging
to work. It has been several years, and I can't remember the specifics.

Strange things happen. I recall once discovering that all of a sudden I
could no longer create a data link. I finally traced it to the installation
of a new mouse. Once I substituted the Microsoft driver for the Logitech
driver, everything returned to normal. Now what does a mouse driver have to
do with data links? I think script blocking possibly has more to do with
CreateObject("Outlook.Applicat*ion") than mouse drivers have to do with data
links. I think you can use the CreateObject method in VBScript.

"Siv" <ms**********@removeme.sivill.com> wrote in message
news:e0*************@TK2MSFTNGP11.phx.gbl...
William,
That's something I wouldn't have thought of. The user has McAfee
antivirus on her machine, and the other users have Sophos Antivirus, she
also runs MS Antispyware beta which they don't either as the Sophos suite
we have installed on the desktop machines covers both antivirus and
spyware threats.

Have you heard that McAfee does this??

Is it just the script blocking part or some other aspect of McAfee?

Thanks for your help, it gives me an avenue to pursue.
--
Siv
Martley, Near Worcester, UK.
"William LaMartin" <la******@tampabay.rr.com> wrote in message
news:eq***************@TK2MSFTNGP14.phx.gbl...
I have read that the script blockers in Antivirus programs may block calls
to CreateObject("Outlook.Applicat*ion"). I know Norton Antivirus has such
a script blocker, for example. I did a quick Google search on
CreateObject("Outlook.Applicat*ion") and antivirus that produced some
interesting messages.

Nov 21 '05 #4
Siv
William
I got the user to turn off "scriptstopper" in McAfee to see if the problem
went away, but it didn't. She also runs MS Anti Spyware so I turned that
off as well and still no good. (Wasn't too keen to have these things turned
off anyway so in some ways I am glad that they weren't the cause of the
problem!).

So the problem must be software and DLL related??
Unless anyone else knows what could be the problem.
--
Siv
Martley, Near Worcester, UK.
"William LaMartin" <la******@tampabay.rr.com> wrote in message
news:ed**************@TK2MSFTNGP14.phx.gbl...
I haven't used McAfee in years. I am only familiar with Norton Antivirus.
I personally had to disable the script blocking in it to get various things
in Microsoft Word to work, possibly also to get Microsoft Document Imaging
to work. It has been several years, and I can't remember the specifics.

Strange things happen. I recall once discovering that all of a sudden I
could no longer create a data link. I finally traced it to the
installation of a new mouse. Once I substituted the Microsoft driver for
the Logitech driver, everything returned to normal. Now what does a mouse
driver have to do with data links? I think script blocking possibly has
more to do with CreateObject("Outlook.Applicat*ion") than mouse drivers
have to do with data links. I think you can use the CreateObject method in
VBScript.

"Siv" <ms**********@removeme.sivill.com> wrote in message
news:e0*************@TK2MSFTNGP11.phx.gbl...
William,
That's something I wouldn't have thought of. The user has McAfee
antivirus on her machine, and the other users have Sophos Antivirus, she
also runs MS Antispyware beta which they don't either as the Sophos suite
we have installed on the desktop machines covers both antivirus and
spyware threats.

Have you heard that McAfee does this??

Is it just the script blocking part or some other aspect of McAfee?

Thanks for your help, it gives me an avenue to pursue.
--
Siv
Martley, Near Worcester, UK.
"William LaMartin" <la******@tampabay.rr.com> wrote in message
news:eq***************@TK2MSFTNGP14.phx.gbl...
I have read that the script blockers in Antivirus programs may block
calls to CreateObject("Outlook.Applicat*ion"). I know Norton Antivirus
has such a script blocker, for example. I did a quick Google search on
CreateObject("Outlook.Applicat*ion") and antivirus that produced some
interesting messages.


Nov 21 '05 #5
Siv
William
I got the user to turn off "scriptstopper" in McAfee to see if the problem
went away, but it didn't. She also runs MS Anti Spyware so I turned that
off as well and still no good. (Wasn't too keen to have these things turned
off anyway so in some ways I am glad that they weren't the cause of the
problem!).

So the problem must be software and DLL related??
Unless anyone else knows what could be the problem.
--
Siv
Martley, Near Worcester, UK.
"William LaMartin" <la******@tampabay.rr.com> wrote in message
news:ed**************@TK2MSFTNGP14.phx.gbl...
I haven't used McAfee in years. I am only familiar with Norton Antivirus.
I personally had to disable the script blocking in it to get various things
in Microsoft Word to work, possibly also to get Microsoft Document Imaging
to work. It has been several years, and I can't remember the specifics.

Strange things happen. I recall once discovering that all of a sudden I
could no longer create a data link. I finally traced it to the
installation of a new mouse. Once I substituted the Microsoft driver for
the Logitech driver, everything returned to normal. Now what does a mouse
driver have to do with data links? I think script blocking possibly has
more to do with CreateObject("Outlook.Applicat*ion") than mouse drivers
have to do with data links. I think you can use the CreateObject method in
VBScript.

"Siv" <ms**********@removeme.sivill.com> wrote in message
news:e0*************@TK2MSFTNGP11.phx.gbl...
William,
That's something I wouldn't have thought of. The user has McAfee
antivirus on her machine, and the other users have Sophos Antivirus, she
also runs MS Antispyware beta which they don't either as the Sophos suite
we have installed on the desktop machines covers both antivirus and
spyware threats.

Have you heard that McAfee does this??

Is it just the script blocking part or some other aspect of McAfee?

Thanks for your help, it gives me an avenue to pursue.
--
Siv
Martley, Near Worcester, UK.
"William LaMartin" <la******@tampabay.rr.com> wrote in message
news:eq***************@TK2MSFTNGP14.phx.gbl...
I have read that the script blockers in Antivirus programs may block
calls to CreateObject("Outlook.Applicat*ion"). I know Norton Antivirus
has such a script blocker, for example. I did a quick Google search on
CreateObject("Outlook.Applicat*ion") and antivirus that produced some
interesting messages.


Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jay | last post by:
Hi, I am using the MailMessage object to send mails. One issue that I am currently facing is that the 'From' address that I provide is not getting resolved. I was testing the code with the same...
3
by: Andrew J | last post by:
Hi all Would really appreciate if someone can help mi with a problem I've been having with ASP generated emails. In fact, this might be a question more related to Outlook than ASP, but in any case...
5
by: Mike | last post by:
I am creating both a text and html version of the same newsletter and sending using CDOSYS. Both of them incorporate a list of stories drawn from a database which are assigned to a variable...
1
by: WillWeGetOurFreedomBack | last post by:
Here is the text of an email I recently received from a user of our Access 2K application. This is totally baffling to me. "WXYZ" = the name of our program for the purpose of this message. ...
3
by: Prakash Wadhwani | last post by:
Hi !! I have been browsing around but have not been able to find a simple, lucid solution ... or maybe I'm just too confused. I know this has been asked before by many ... but pls bear with me. ...
9
by: bobdydd | last post by:
Hullo Everybody I am trying to send a email from WITHIN Access 2000 with a report attached that is generated WITHIN Access in the normal way, but all the help examples I have seen uses an...
1
by: sxwend | last post by:
I am trying to use the following post results (http://www.thescripts.com/forum/thread189759.html) and add another requirement. I need to send the results to just the email addresses that the query...
1
by: 1andy1 | last post by:
Hello, I have a following problem. Development environment Windows XP, VS 2008, Outlook 2003. Deployment environment Small bussiness server, Outlook 2000. I have created a small VB .Net program...
28
tdw
by: tdw | last post by:
Hi all, I am trying to add a feature to our database that automates sending emails. When entering a new order, I want the option to send an email to the company the order came from, attaching a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.