A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook.application startup differences Outlook 200 vs 2003 Please help ;-)



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old July 18th 06, 11:40 AM posted to microsoft.public.outlook.program_vba
Dikbill
external usenet poster
 
Posts: 16
Default Outlook.application startup differences Outlook 200 vs 2003 Please help ;-)

Hi there,

I'm creating a synchronisation program which wil synchronise
data between Outlook and our own database.
We want our program to work with Outlook 2000 and up.
The program is made with VB 2005 to communicate with a
standalone Outlook 2000/2003 Outlook client.

The problem I have is connecting with Outlook.
When the program starts, there can be 3 situations:

1. Outlook.exe isn't running
2. Outlook is running but invisible (Application.Explorers.Count=0)
3. Outlook is running visible


This is my startup code:

olApplication = New Outlook.Application
msgbox (olApplication.Version)

Now I discribe the above 3 situations from both Outlook 2000 and 2003

---Outlook 2003 situation 1-----------------------------------------------
Outlook is started but unvisible, that's not what I want.
The program starts with no errors, I can interact with Outlook.

---Outlook 2003 situation 2-----------------------------------------------
Outlook is started but unvisible, that's not what I want.
The program starts with no errors, I can interact with Outlook.
Every time when I start my program, a new instance of Outlook.exe
is started!! That's not what I want.

---Outlook 2003 situation 3-----------------------------------------------
Outlook not started again, that's good.
The program starts with no errors, I can interact with Outlook.
This is what I want!

---Outlook 2000 situation 1-----------------------------------------------
Outlook is started but unvisible, that's not what I want.
The program starts with no errors, I can interact with Outlook.

---Outlook 2000 situation 2-----------------------------------------------
Outlook isn't started, it will give the following error when it want's to
execute
the line msgbox (olApplication.Version)

System.Runtime.InteropServices.COMException was unhandled
ErrorCode=-2146788252
Message="Exception from HRESULT: 0x800A9C64"
Source="mscorlib"
StackTrace:
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags
invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32
culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags
bindingFlags, Binder binder, Object target, Object[] providedArgs,
ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at
Microsoft.VisualBasic.CompilerServices.VBBinder.In vokeMember(String name,
BindingFlags invokeAttr, Type objType, IReflect objIReflect, Object target,
Object[] args, String[] namedParameters)
at Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object
o, Type objType, String name, Object[] args, String[] paramnames, Boolean[]
CopyBack)
at
Microsoft.VisualBasic.CompilerServices.NewLateBind ing.LateGet(Object
Instance, Type Type, String MemberName, Object[] Arguments, String[]
ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
at Outlook_CRM_Sync.AGENDA_MAIN.Opstart() in
C:\TestDotNet\CRM_sync\Outlook_CRM_Sync\Outlook_CR M_Sync\AGENDA_MAIN.vb:line
41
at Outlook_CRM_Sync.AGENDA_MAIN.AGENDA_MAIN_Load(Obje ct sender,
EventArgs e) in
C:\TestDotNet\CRM_sync\Outlook_CRM_Sync\Outlook_CR M_Sync\AGENDA_MAIN.vb:line
23
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeNativeMethods.ShowWindow( HandleRef hWnd,
Int32 nCmdShow)
at System.Windows.Forms.Control.SetVisibleCore(Boolea n value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at
System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Outlook_CRM_Sync.AGENDA_MAIN.Main() in
C:\TestDotNet\CRM_sync\Outlook_CRM_Sync\Outlook_CR M_Sync\AGENDA_MAIN.Designer.vb:line
2
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

---Outlook 2000 situation 3-----------------------------------------------
Same as Outlook 2000 situation 2

What I am doing wrong????
Anyone??

Tx a lot,

Dikbill, The Netherlands







 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2003 startup chemnut94707 Outlook - Using Contacts 1 May 5th 06 11:13 PM
Implementation differences in VS 2003 and VS 2005 regarding outloo Peeyush Outlook - Using Forms 1 April 17th 06 01:35 PM
Outlook 200 won't shut down ... Grumpy Aero Guy Outlook - General Queries 2 April 10th 06 01:33 PM
Outlook 2003 crash on startup in WinXP [email protected] Outlook - General Queries 0 February 21st 06 07:02 PM
Outlook 2003 startup script error [email protected] Outlook - General Queries 0 January 24th 06 07:34 PM


All times are GMT +1. The time now is 08:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.