How to use current outlook? 
Author Message
 How to use current outlook?

Hi!

I'm looking for a way how to use the current Outlook. I'm writing a programm
that has to read the selected email.

With

oOutlook = createobject("outlook.application")

I can only create a new instance of Outlook.

Anybody an idea?

Thanxs a lot!

Michel



Sun, 05 Jan 2003 03:00:00 GMT  
 How to use current outlook?

instead of createobject, use getobject  =)

i think.  but try it.

jb



Quote:
> Hi!

> I'm looking for a way how to use the current Outlook. I'm writing a
programm
> that has to read the selected email.

> With

> oOutlook = createobject("outlook.application")

> I can only create a new instance of Outlook.

> Anybody an idea?

> Thanxs a lot!

> Michel



Sun, 19 Jan 2003 03:00:00 GMT  
 How to use current outlook?

I think I have already seen something in Delphi like this:

try
    s :=getobject (outlook.application);
except
    s :=createobject (outlook.aplication);
end;

The syntax is certainly wrong, but that's the idea.

Rafael



Quote:
> instead of createobject, use getobject  =)

> i think.  but try it.

> jb



> > Hi!

> > I'm looking for a way how to use the current Outlook. I'm writing a
> programm
> > that has to read the selected email.

> > With

> > oOutlook = createobject("outlook.application")

> > I can only create a new instance of Outlook.

> > Anybody an idea?

> > Thanxs a lot!

> > Michel



Mon, 20 Jan 2003 03:00:00 GMT  
 How to use current outlook?
You don't want to use CreateObject which will always create a new instance
of Outlook but the GetObject is the correct command when an instance is
already open.

Set x = GetObject("", "Outlook.Application")

Stephen King


Quote:

> Hi!

> I'm looking for a way how to use the current Outlook. I'm writing a
programm
> that has to read the selected email.

> With

> oOutlook = createobject("outlook.application")

> I can only create a new instance of Outlook.

> Anybody an idea?

> Thanxs a lot!

> Michel



Sat, 25 Jan 2003 03:00:00 GMT  
 How to use current outlook?

I go a bit farther:

        Dim objOA As Object
        Set objOA = Outlook.Application

        If TypeName(objOA) = "Nothing" Then
            Dim objOL As Object
            objOL = CreateObject("Outlook.Application")
            Set objOA = New Outlook.Application
        End If

Is this a reasonable solution?  Or would GetObject create one if none were
found to exist?

-Bill Kearney

Quote:

> You don't want to use CreateObject which will always create a new instance
> of Outlook but the GetObject is the correct command when an instance is
> already open.

> Set x = GetObject("", "Outlook.Application")

> > I'm looking for a way how to use the current Outlook. I'm writing a
programm
> > that has to read the selected email.



Fri, 04 Apr 2003 03:00:00 GMT  
 How to use current outlook?

Quote:

> I go a bit farther:

>         Dim objOA As Object
>         Set objOA = Outlook.Application

>         If TypeName(objOA) = "Nothing" Then
>             Dim objOL As Object
>             objOL = CreateObject("Outlook.Application")
>             Set objOA = New Outlook.Application
>         End If

> Is this a reasonable solution?  Or would GetObject create one if none were
> found to exist?

You are getting confused.  If GetObject or CreateObject work then you do not
do a set.

 Dim objOA as Object
 objOA = GetObject("Outlook.Application")

 If TypeName(objOA) = "Nothing" then
   objOA = CreateObject("Outlook.Application")
 End if

 An alternative approach:  Just do the CreateObject, get the Explorer
collection object, and pull out the first Explorer Item from the collection.  
That will be the pre-existing Outlook explorer.  Get the Application object
from there.  Dismiss your created application object.



Sat, 05 Apr 2003 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Retrieving the profile name used by the current user in Outlook

2. Outlook.exe process still running after using Outlook Object

3. Detecting current Outlook session

4. Set Current Folder In Outlook ( Need ASAP)

5. using outlook 97 object model with outlook 95?

6. Outlook 2000 Customize Current View --> Attachment FileName

7. Getting the Current Time-Selection from Outlook 2002 Calendar

8. Outlook 2000 VBA: Making New Appointment in Current Folder

9. Pointers using Outlook/Outlook Express Rules - Sending back tailored emails

10. Creating mail accounts for Outlook/Outlook Express using VB

11. Current message in Outlook

12. CURRENT MESSAGE in Outlook - VB script

 

 
Powered by phpBB® Forum Software