473,387 Members | 1,365 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,387 software developers and data experts.

The remote server machine does not exist or is unavailable: 'golApp.GetNamespace' (MAPI)

Hi,

I have a VB.NET-application that has to open an email in Outlook. for this I
have some VBA-code in a MSScriptControl.
This works like always, but sometimes it thorws this error:

"
4/08/2004 08:16:56 Exception of type System.Exception was thrown.
DScriptControlSource_Event_Error DScriptControlSource_Event_Error
04/08/2004 08:16:56 The remote server machine does not exist or is
unavailable: 'golApp.GetNamespace' at
MSScriptControl.ScriptControlClass.Run(String ProcedureName, Object[]&
Parameters)
at VocalcomCetelem.frmAgent.AxToolbar1_MailSuccess(Ob ject sender,
_IToolbarEvents_MailSuccessEvent e)
"

It seems that I have this errors when something is wrong with Outlook. I
thought that this happens when Outlook is closed, but after you start it up
it the error stays. Does anybody know why this happens like this?

Thanks a lot in advance!

Pieter
You can find the code here:

'*******VB.NET*************
'declaration of my ScriptControl
Private WithEvents sccMailScript As New MSScriptControl.ScriptControlClass

'initialiszation
sccMailScript.Language = "VBScript"
sccMailScript.AddObject("Toolbar", AxToolbar1, True)
'strText = the *.vbs
sccMailScript.AddCode(strText)
sccMailScript.Run("OnLoad")

'to open the email I run this:
sccMailScript.Run("OnMailSuccess")
'******END VB.NET*************
'******VBS*************
Dim golApp
Dim objInspector

Sub OnLoad
Set golApp = CreateObject("Outlook.Application.8") 'New
Outlook.Application
End Sub

Sub OnWrapupEnd
on error resume next
Application.Navigate ""
if not objInspector is nothing then
objInspector.Close(1)
end if
on error goto 0
End Sub

Sub OnMailSuccess
Dim gnspNameSpace
Dim gmfInbox
Dim gmiItem

Set gnspNameSpace = golApp.GetNamespace("MAPI")

for j=1 to gnspNameSpace.Folders.Count
if instr(1,gnspNameSpace.Folders.Item(j).Name,"Fax")> 0 then

set gmfInbox = gnspNameSpace.Folders.Item(j).Folders.Item(4)
For i = 1 To gmfInbox.Items.Count

Set gmiItem = gmfInbox.Items.Item(i)
If gmiItem.EntryID = Toolbar.CallInformation(1).ItemID Then
Set objInspector = gmiItem.GetInspector
objInspector.Display
Exit For
End If
Next

end if
next
End Sub
'*******END VBS**************
Nov 20 '05 #1
0 4769

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

Similar topics

0
by: token | last post by:
I am trying to connect to a remote exchage server in order to retrieve emails and process them. My problem is that I have no idea how to connect to the remote exchange server. I have the...
0
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool including SourceOffSite, SourceAnyWhere and VSS Remoting This article makes a detailed...
2
by: Bassel Tabbara | last post by:
I wrote the following code: oApp = new Outlook.Application(); oApp = new Outlook.Application(); oNameSpace= oApp.GetNamespace("MAPI"); oNameSpace.Logon(null,null,true,true); //gets defaultfolder...
2
by: Jeff | last post by:
I have an ASP.NET web page accessing a SQL database. I've used VS to build the app and stored it in the eNPTest02 directory of my localhost on my development machine. The database is on the web. ...
4
by: Pieter | last post by:
Hi, On the pc of one of my clients (W2000, Office 2003) I'm getting sometimes an exception when moving (Move) a MailItem to an Outlook-Folder: The RPC server is not available. (Exception from...
17
by: Jon B | last post by:
Hi All! I have a ASP.NET 2.0 site that works on the Windows 2000 Server. However, when I tried to view this site on my local Windows XP machine, I get "Server Unavailable". If I switch the...
13
by: Kevin Liebowicz | last post by:
Yes, I wasted the past two days trying to fix this. Yes, this is on a Win2003 Server. Yes, this machine is a domain controller. Yes, I seen the dozens of KB articles like this one:...
5
by: =?Utf-8?B?QWRyaWFuTW9ycmlz?= | last post by:
Hello! I'm trying to copy a file from another computer on the network that I do not have permission with my current logon details to access. If I open the folder using the Windows file manager...
2
by: subint | last post by:
We have a button "Print' in our application,after clicking the Print button it will open a new window. Close the new window and click Print button again, below error is displayed. "The remote...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.