JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for EXCEL-VB-DISCUSS Archives


EXCEL-VB-DISCUSS Archives

EXCEL-VB-DISCUSS Archives


EXCEL-VB-DISCUSS@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

EXCEL-VB-DISCUSS Home

EXCEL-VB-DISCUSS Home

EXCEL-VB-DISCUSS  March 2001

EXCEL-VB-DISCUSS March 2001

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: Email through XL failing

From:

"[log in to unmask]" <[log in to unmask]>

Reply-To:

A list to stimulate discussion about the technical aspects of the developme <[log in to unmask]>

Date:

Wed, 14 Mar 2001 11:28:37 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (413 lines)

Thanks for the correction to the code.
Unfortunately it still falls down on the line .Send.
AAARRGGHHHHH! (sorry, excuse me. I feel slightly better now)
Thanks again
--
Steve Dunn

QA Inspector
HTEC Ltd
Southampton
UK
(023) 80 516088
-----Original Message-----
From: Dhillon, Kuljeet [mailto:[log in to unmask]]
Sent: 14 March 2001 10:30
To: [log in to unmask]
Subject: Re: Email through XL failing


Sorry Steve,

My mistake. Replace:
Dim OL As Object
Set OL = CreateObject("Outlook.Application")

with:

Dim appOL As New Outlook.Application
Set appOL = CreateObject("Outlook.Application")

HTH

Kuljeet
-----Original Message-----
From: [log in to unmask] [mailto:[log in to unmask]]
Sent: 14 March 2001 10:15
To: [log in to unmask]
Subject: Re: Email through XL failing


Sorry Kuljeet,

but sadly this hasn't helped. In fact it crashes out on the line
Set nsOL = appOL.GetNamespace("MAPI")
the reason for which I don't know, but it could well be me.
Nevertheless your efforts are greatly appreciated.

Brendon: I have the following libraries checked:
        Visual Basic for Applications
        MS Excel 8.0 Object Library
        Outlook 98 Type Library
        OLE Automation
        MS Forms 2.0 Object Library
        MS Office 8.0 Object Library
in that order.
As for using MailSendItem.Send - it still fails on the said line.
--
Steve Dunn

QA Inspector
HTEC Ltd
Southampton
UK
(023) 80 516088
-----Original Message-----
From: Dhillon, Kuljeet [mailto:[log in to unmask]]
Sent: 13 March 2001 14:22
To: [log in to unmask]
Subject: Re: Email through XL failing


Steve,

Try code below. Keep your

Dim OL As Object, MailSendItem As Object
Set OL = CreateObject("Outlook.Application")

If you havn't already done so add:

Dim nsOL As Outlook.NameSpace
Set nsOL = appOL.GetNamespace("MAPI")

HTH

Kuljeet

Sub SendNewMail(NewRecipient As String, NewSubject As String, NewMessage As
String, Optional NewCC As String, Optional NewAttachment As String)
Dim olOutBox As Outlook.MAPIFolder
    Set olOutBox = nsOL.GetDefaultFolder(olFolderOutbox) ' Set the folder to
the outbox of email application
    Dim olNewMailItem As Outlook.MailItem
    Set olNewMailItem = olOutBox.Items.Add(olMailItem) 'Create a new mail
item
        With olNewMailItem
            .Recipients.Add NewRecipient 'To whom the mail is intended for
            .CC = "[log in to unmask];" & NewCC 'Copy to
            .Subject = NewSubject
            .Body = vbCrLf & strStandardText & vbCrLf & vbCrLf & NewMessage
'Message for the email
            .Recipients.ResolveAll
                If NewAttachment = "" Then ' If there is not an attachment
send mail
                    .Send
                Else
                    .Attachments.Add NewAttachment, , 1 ' If there is an
attachment, attach and send mail
                    .Send
                End If
            End With
    Set olNewMailItem = Nothing
    Set olOutBox = Nothing
End Sub

-----Original Message-----
From: [log in to unmask] [mailto:[log in to unmask]]
Sent: 13 March 2001 14:08
To: [log in to unmask]
Subject: Re: Email through XL failing


Hi Neil,
(Thanks for sticking with me)
Hmmm...!
Looked under the object browser - yes .Send is there under MailItem.
I've also tried the long email address ([log in to unmask]) and still no joy.
I've tried the process on a machine that hasn't yet been 'uprgraded'. No
prizes for guessing that there are NO problems. I shall throw this our IT
dept. However if you can think of anything I would be very grateful if you
could let me know.
I'll try the send keys method that Jon Tydda suggested.

In the meantime thanks to everyone for your time and patience,
All the best,
--
Steve Dunn
QA Inspector
HTEC Ltd
Southampton
UK
(023) 80 516088
-----Original Message-----
From: Allcock, Neil [mailto:[log in to unmask]]
Sent: 13 March 2001 12:42
To: [log in to unmask]
Subject: RE: Email through XL failing
i've run it on mine and it works
i'm on NT4 using Excel 97 & Outlook 97
try looking in View>object Browser
and under mailitem see if you can see .Send
maybe the syntax is slightly different
or try putting your Long email address
instead of your shortend one...[hang on that could be it!!!]

> -----Original Message-----
> From: [log in to unmask] [SMTP:[log in to unmask]]
> Sent: Tuesday, March 13, 2001 12:27 PM
> To:   'Allcock, Neil'
> Subject:      RE: Email through XL failing
>
> I get "error in loading DLL"
>
> Doh!
>
> --
> Steve Dunn
>
> QA Inspector
> HTEC Ltd
> Southampton
> UK
> (023) 80 516088
>
>
> -----Original Message-----
> From: Allcock, Neil [mailto:[log in to unmask]]
> Sent: 13 March 2001 12:24
> To: [log in to unmask]
> Subject: RE: Email through XL failing
>
>
> give it a go see what happens
>
> > -----Original Message-----
> > From:       [log in to unmask] [SMTP:[log in to unmask]]
> > Sent:       Tuesday, March 13, 2001 12:20 PM
> > To: [log in to unmask]
> > Subject:    Re: Email through XL failing
> >
> > Ken and Neil,
> >
> > I have the following reference checked:-
> > "Outlook 98 Type Library"
> >
> > The only other reference that I can see relating to outlook is:-
> > "Microsoft Outlook Express 5.0 type library"
> >
> > Should this also be checked?
> > --
> > Steve Dunn
> >
> > QA Inspector
> > HTEC Ltd
> > Southampton
> > UK
> > (023) 80 516088
> >
> >
> > -----Original Message-----
> > From: Allcock, Neil [mailto:[log in to unmask]]
> > Sent: 13 March 2001 12:13
> > To: [log in to unmask]
> > Subject: Re: Email through XL failing
> >
> >
> > have you no references no anything Outlook?
> > mine is Microsoft Outlook 8.0 Object library
> > the file is msoutl8.odb
> > HTH
> >
> > > -----Original Message-----
> > > From: Hardwick, Ken [SMTP:[log in to unmask]]
> > > Sent: Tuesday, March 13, 2001 12:09 PM
> > > To:   [log in to unmask]
> > > Subject:      Re: Email through XL failing
> > >
> > > Steve,
> > > In looking at a Excel file that I had developed that I used to send
> > email
> > > thru OutLook...
> > > it has a reference to "Outlook 98 Type Library"...
> > >
> > > But, would appear that you should have a reference to something that
> > > refers
> > > to
> > > "Outlook 98"...
> > >
> > > Ken Hardwick
> > > Norman,OK
> > >
> > >
> > > -----Original Message-----
> > > From: [log in to unmask] [mailto:[log in to unmask]]
> > > Sent: Tuesday, March 13, 2001 5:59 AM
> > > To: [log in to unmask]
> > > Subject: Re: Email through XL failing
> > >
> > >
> > > Ken,
> > >
> > > I had already looked to see if any references in the list should have
> > been
> > > checked.
> > >
> > > However, there is no "Microsoft Outlook 98 Object Model" reference in
> > the
> > > list (checked or un-checked)! Worrying...
> > >
> > > I'm now in a darkened room with sunglasses on...  :o{
> > >
> > > --
> > > Steve Dunn
> > >
> > > QA Inspector
> > > HTEC Ltd
> > > Southampton
> > > UK
> > > (023) 80 516088
> > > -----Original Message-----
> > > From: Hardwick, Ken [mailto:[log in to unmask]]
> > > Sent: 13 March 2001 11:48
> > > To: [log in to unmask]
> > > Subject: Re: Email through XL failing
> > >
> > >
> > > Have you changed your "references" to "Microsoft Outlook 98 Object
> > Model"
> > > ?
> > >
> > >
> > > -----Original Message-----
> > > From: [log in to unmask] [mailto:[log in to unmask]]
> > > Sent: Tuesday, March 13, 2001 5:46 AM
> > > To: [log in to unmask]
> > > Subject: Email through XL failing
> > >
> > >
> > > Hello all,
> > >
> > > I hate to rake over old turf but.....
> > >
> > > I've been using the code below successfully for a long while now.
> > Recently
> > > our IT dept upgraded machines from using MS Exchange to MS Oulook 98.
> > Now
> > > the code errors with:
> > >         "Application-defined or object-defined error"
> > >
> > > with debug leading me to the line: -    .Send
> > >
> > > I've been through the archives and all message on the topic use this
> > line
> > > so
> > > I am at a loss as to why this isn't working.
> > >
> > > Can anyone help me please.....?
> > >
> > > Here's the code:
> > > ************************************
> > > Dim OL As Object, MailSendItem As Object
> > > Set OL = CreateObject("Outlook.Application")
> > > Set MailSendItem = OL.CreateItem(olMailItem)
> > > With MailSendItem
> > >         .Subject = "UCL Exceeded!"
> > >         .Body = "This is notification to inform you that ........."
> > >         .To = "SDunn"
> > >         .Send
> > > End With
> > > Set OL = Nothing
> > > ***************************************
> > > Thanks....
> > > --
> > > Steve Dunn
> > >
> > > QA Inspector
> > > HTEC Ltd
> > > Southampton
> > > UK
> > > (023) 80 516088
> > >
> > >
> >
> --------------------------------------------------------------------------
> > > The EXCEL-L list is hosted on a Windows NT(TM) machine running L-Soft
> > > international's LISTSERV(R) software.  For subscription/signoff info
> > > and archives, see http://peach.ease.lsoft.com/archives/excel-l.html .
> > >
> > >
> >
> --------------------------------------------------------------------------
> > > The EXCEL-L list is hosted on a Windows NT(TM) machine running L-Soft
> > > international's LISTSERV(R) software.  For subscription/signoff info
> > > and archives, see http://peach.ease.lsoft.com/archives/excel-l.html .
> > >
> > >
> >
> --------------------------------------------------------------------------
> > > The EXCEL-L list is hosted on a Windows NT(TM) machine running L-Soft
> > > international's LISTSERV(R) software.  For subscription/signoff info
> > > and archives, see http://peach.ease.lsoft.com/archives/excel-l.html .
> > >
> > >
> >
> --------------------------------------------------------------------------
> > > The EXCEL-L list is hosted on a Windows NT(TM) machine running L-Soft
> > > international's LISTSERV(R) software.  For subscription/signoff info
> > > and archives, see http://peach.ease.lsoft.com/archives/excel-l.html .
> > The Information contained in this message is confidential and may be
> > legally
> > privileged and is intended for the addressee only. If you have received
> > this
> > message in error or there are any problems please notify the originator
> > immediately. The unauthorised use, disclosure, copying or alteration of
> > this
> > message is strictly forbidden. This mail and any attachments have been
> > scanned for viruses prior to leaving EWS Ltd's network. EWS Ltd will not
> > be
> > liable for direct, special, indirect or consequential damages arising
> from
> > alteration of the contents of this message by a third party or as a
> result
> > of any virus being passed on.
> > For more information about EWS Ltd, please see our website:-
> > www.ews-railway.co.uk
> >
> >
> --------------------------------------------------------------------------
> > The EXCEL-L list is hosted on a Windows NT(TM) machine running L-Soft
> > international's LISTSERV(R) software.  For subscription/signoff info
> > and archives, see http://peach.ease.lsoft.com/archives/excel-l.html .
> >
> >
> --------------------------------------------------------------------------
> > The EXCEL-L list is hosted on a Windows NT(TM) machine running L-Soft
> > international's LISTSERV(R) software.  For subscription/signoff info
> > and archives, see http://peach.ease.lsoft.com/archives/excel-l.html .
> The Information contained in this message is confidential and may be
> legally
> privileged and is intended for the addressee only. If you have received
> this
> message in error or there are any problems please notify the originator
> immediately. The unauthorised use, disclosure, copying or alteration of
> this
> message is strictly forbidden. This mail and any attachments have been
> scanned for viruses prior to leaving EWS Ltd's network. EWS Ltd will not
> be
> liable for direct, special, indirect or consequential damages arising from
> alteration of the contents of this message by a third party or as a result
> of any virus being passed on.
> For more information about EWS Ltd, please see our website:-
> www.ews-railway.co.uk
The Information contained in this message is confidential and may be legally
privileged and is intended for the addressee only. If you have received this
message in error or there are any problems please notify the originator
immediately. The unauthorised use, disclosure, copying or alteration of this
message is strictly forbidden. This mail and any attachments have been
scanned for viruses prior to leaving EWS Ltd's network. EWS Ltd will not be
liable for direct, special, indirect or consequential damages arising from
alteration of the contents of this message by a third party or as a result
of any virus being passed on.
For more information about EWS Ltd, please see our website:-
www.ews-railway.co.uk

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

September 2015
February 2012
November 2011
October 2011
September 2011
July 2011
June 2011
April 2011
March 2011
February 2011
August 2010
June 2010
May 2010
January 2010
November 2009
September 2009
August 2009
July 2009
January 2009
September 2008
August 2008
July 2008
June 2008
May 2008
March 2008
February 2008
January 2008
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
January 2001
December 2000
November 2000
October 2000
September 2000
August 2000
July 2000
June 2000
May 2000
April 2000
March 2000
February 2000
January 2000
December 1999
November 1999
October 1999
September 1999
August 1999
July 1999
June 1999
May 1999
April 1999
March 1999
February 1999
January 1999
December 1998
November 1998
October 1998
September 1998
August 1998
July 1998
June 1998
May 1998
April 1998
March 1998


WWW.JISCMAIL.AC.UK

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager