Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 363
Default Open Outlook from a macro

I have a code to send(email) a range of a worksheet to an email addres on
the sheet.
But if Outlook is not opened it simply sits in the OUTBOX until Outlook is
opened.
Is ther a line i can add to open Outlook if Not already.
This way it Will send immediately ?

Corey...


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Open Outlook from a macro

Check out this site...

http://www.rondebruin.nl/sendmail.htm
--
HTH...

Jim Thomlinson


"Corey" wrote:

I have a code to send(email) a range of a worksheet to an email addres on
the sheet.
But if Outlook is not opened it simply sits in the OUTBOX until Outlook is
opened.
Is ther a line i can add to open Outlook if Not already.
This way it Will send immediately ?

Corey...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Open Outlook from a macro

Thanks for the reply,
But Ron's site is very helpful, yet does not assist me with the OPENING on
Outlook from a Macro.

Corey....
"Jim Thomlinson" wrote in message
...
Check out this site...

http://www.rondebruin.nl/sendmail.htm
--
HTH...

Jim Thomlinson


"Corey" wrote:

I have a code to send(email) a range of a worksheet to an email addres on
the sheet.
But if Outlook is not opened it simply sits in the OUTBOX until Outlook
is
opened.
Is ther a line i can add to open Outlook if Not already.
This way it Will send immediately ?

Corey...





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Open Outlook from a macro

It should do.

To start Outlook, just test it and open it

On Error Resume Next
Set AppOL = GetObject(,"Outlook.Application")
If AppOL Is Nothing Then
Set AppOL = CreateObject("Outlook.Application")
If AppOL Is Nothing Then
MsgBox "Something's up"
Exit Sub
Else
AppOL.Visible = True
End If
End If


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Corey" wrote in message
...
Thanks for the reply,
But Ron's site is very helpful, yet does not assist me with the OPENING on
Outlook from a Macro.

Corey....
"Jim Thomlinson" wrote in
message ...
Check out this site...

http://www.rondebruin.nl/sendmail.htm
--
HTH...

Jim Thomlinson


"Corey" wrote:

I have a code to send(email) a range of a worksheet to an email addres
on
the sheet.
But if Outlook is not opened it simply sits in the OUTBOX until Outlook
is
opened.
Is ther a line i can add to open Outlook if Not already.
This way it Will send immediately ?

Corey...







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Open Outlook from a macro

Thanks for the reply Bob.

Am I suppose to any more than to test the code you posted than to run it
from a macro?
It thinks but does nothing??


Corey....
"Bob Phillips" wrote in message
...
It should do.

To start Outlook, just test it and open it

On Error Resume Next
Set AppOL = GetObject(,"Outlook.Application")
If AppOL Is Nothing Then
Set AppOL = CreateObject("Outlook.Application")
If AppOL Is Nothing Then
MsgBox "Something's up"
Exit Sub
Else
AppOL.Visible = True
End If
End If


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Corey" wrote in message
...
Thanks for the reply,
But Ron's site is very helpful, yet does not assist me with the OPENING
on Outlook from a Macro.

Corey....
"Jim Thomlinson" wrote in
message ...
Check out this site...

http://www.rondebruin.nl/sendmail.htm
--
HTH...

Jim Thomlinson


"Corey" wrote:

I have a code to send(email) a range of a worksheet to an email addres
on
the sheet.
But if Outlook is not opened it simply sits in the OUTBOX until Outlook
is
opened.
Is ther a line i can add to open Outlook if Not already.
This way it Will send immediately ?

Corey...











  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Open Outlook from a macro

I just gave you code to test whether Outlook was started, if not start it.

You would add this to some code to send the mail.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Corey" wrote in message
...
Thanks for the reply Bob.

Am I suppose to any more than to test the code you posted than to run it
from a macro?
It thinks but does nothing??


Corey....
"Bob Phillips" wrote in message
...
It should do.

To start Outlook, just test it and open it

On Error Resume Next
Set AppOL = GetObject(,"Outlook.Application")
If AppOL Is Nothing Then
Set AppOL = CreateObject("Outlook.Application")
If AppOL Is Nothing Then
MsgBox "Something's up"
Exit Sub
Else
AppOL.Visible = True
End If
End If


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Corey" wrote in message
...
Thanks for the reply,
But Ron's site is very helpful, yet does not assist me with the OPENING
on Outlook from a Macro.

Corey....
"Jim Thomlinson" wrote in
message ...
Check out this site...

http://www.rondebruin.nl/sendmail.htm
--
HTH...

Jim Thomlinson


"Corey" wrote:

I have a code to send(email) a range of a worksheet to an email addres
on
the sheet.
But if Outlook is not opened it simply sits in the OUTBOX until
Outlook is
opened.
Is ther a line i can add to open Outlook if Not already.
This way it Will send immediately ?

Corey...











  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Open Outlook from a macro

This works for me:
Sub ShowOutlook()

Dim olApp As OutLook.Application
Dim olNs As NameSpace

On Error Resume Next
Set olApp = GetObject(, "Outlook.Application")

If Err.Number = 429 Then
Set olApp = CreateObject("Outlook.Application")
End If

On Error GoTo 0

Set olNs = olApp.GetNamespace("MAPI")

If olApp.ActiveExplorer Is Nothing Then
olApp.Explorers.Add _
(olNs.GetDefaultFolder(olFolderCalendar)).Activate
Else
Set olApp.ActiveExplorer.CurrentFolder = _
olNs.GetDefaultFolder(olFolderCalendar)
olApp.ActiveExplorer.Display
End If

Set olNs = Nothing
Set olApp = Nothing

End Sub

I found it at:
http://www.dicks-clicks.com/excel/olBinding.htm

Remember to activate the reference in the Visual Basic Editor, Tools
References...
Happy Excelling!!


--
RyGuy


"Bob Phillips" wrote:

I just gave you code to test whether Outlook was started, if not start it.

You would add this to some code to send the mail.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Corey" wrote in message
...
Thanks for the reply Bob.

Am I suppose to any more than to test the code you posted than to run it
from a macro?
It thinks but does nothing??


Corey....
"Bob Phillips" wrote in message
...
It should do.

To start Outlook, just test it and open it

On Error Resume Next
Set AppOL = GetObject(,"Outlook.Application")
If AppOL Is Nothing Then
Set AppOL = CreateObject("Outlook.Application")
If AppOL Is Nothing Then
MsgBox "Something's up"
Exit Sub
Else
AppOL.Visible = True
End If
End If


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Corey" wrote in message
...
Thanks for the reply,
But Ron's site is very helpful, yet does not assist me with the OPENING
on Outlook from a Macro.

Corey....
"Jim Thomlinson" wrote in
message ...
Check out this site...

http://www.rondebruin.nl/sendmail.htm
--
HTH...

Jim Thomlinson


"Corey" wrote:

I have a code to send(email) a range of a worksheet to an email addres
on
the sheet.
But if Outlook is not opened it simply sits in the OUTBOX until
Outlook is
opened.
Is ther a line i can add to open Outlook if Not already.
This way it Will send immediately ?

Corey...












Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to open Excel in different windows AND open from Outlook? KimD Setting up and Configuration of Excel 0 January 25th 10 07:47 PM
SendMail without open Outlook Ron de Bruin Excel Programming 0 December 8th 06 04:33 PM
excel open in outlook if outlook is running kirk Excel Discussion (Misc queries) 0 May 24th 06 06:42 PM
Open Outlook JEFF Excel Programming 3 July 20th 05 09:30 AM
open outlook contact Martin Excel Discussion (Misc queries) 0 May 4th 05 05:48 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"