Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NameSpace Logon problem - wrong code, or just possessed?

Status
Not open for further replies.
Dec 18, 2003
8
US
Hi folks, it's been another grand frustrating day! I'm trying to mail from Access using the NameSpace Logon method with embedded profile and password. However, I cannot seem to get it to work. The code breaks with an error at the last line of this segement.

**********
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
Dim strBody As String
Set objOutlook = New Outlook.Application
Set myNameSpace = objOutlook.GetNamespace("MAPI")
myNameSpace.Logon "someprofile", "somepassword", False, True
Set objEmail = objOutlook.CreateItem(olMailItem)
*************

The error msg is "Cannot create the email msg because a location to send and receive msgs could not be found". Is the fact our Exchange server sits on a Novell network have anything to do with this or is my code just junk? From the documentation I've read it APPEARS like I'm doing this right, but obviously something is wrong or missing. Any input is GREATLY appreciated!

"Some mornings it just doesn't seem worth it to gnaw through the leather straps.
 
This code works for me :-

'---------------------------------------
Set MyMail = CreateObject("Outlook.application")
Set MyItem = MyMail.createitem(olmailitem)
Set MyAttachments = MyItem.attachments
Set MyRecipients = MyItem.Recipients
'------------------------------------------


Regards
BrianB
Use CupOfCoffee to speed up all windows applications
================================
 

Thanks for responding, Brian! Yes, I use code similar to that to mail in various ways.

However, this time I must use the NameSpace method so notices may be sent without opening Outlook (coming from a production line box; a valid profile set up on the box to allow the mapi login but no Outlook account or access allowed for the operators.)


thanks....

[morning]

"Some mornings it just doesn't seem worth it to gnaw through the leather straps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top