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

Insert standard text into a new message



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 23rd 08, 03:08 AM posted to microsoft.public.outlook.program_vba
Gabe
external usenet poster
 
Posts: 18
Default Insert standard text into a new message

Hello,

I am pretty new at this but, how do you insert standard text into a new
e-mail message without deleting the default signature? I am using the
following code:


Sub Macro1()
Set OutLk = CreateObject("Outlook.Application")
Set Email = OutLk.CreateItem(0)
With Email
..To = "
..Subject = "New Message"
..Body = "Hello?"
..Display
End With
Set Email = Nothing
Set OutLk = Nothing
End Sub
  #2  
Old January 23rd 08, 04:57 AM posted to microsoft.public.outlook.program_vba
JP[_3_]
external usenet poster
 
Posts: 201
Default Insert standard text into a new message

Try

.Body = "Hello?" & .Body



HTH,
JP

On Jan 22, 9:08*pm, Gabe wrote:
Hello,

I am pretty new at this but, how do you insert standard text into a new
e-mail message without deleting the default signature? I am using the
following code:

Sub Macro1()
Set OutLk = CreateObject("Outlook.Application")
Set Email = OutLk.CreateItem(0)
With Email
.To = "
.Subject = "New Message"
.Body = "Hello?"
.Display
End With
Set Email = Nothing
Set OutLk = Nothing
End Sub


  #3  
Old January 23rd 08, 05:26 PM posted to microsoft.public.outlook.program_vba
Gabe
external usenet poster
 
Posts: 18
Default Insert standard text into a new message

No, a message box came up that said (A program is trying to access e-mail
addresses you have stored in Outlook. Do you want tp allow this?

If this is unexpected, it may be a virus and you should choose "No".)

So when I click on No it does nothing, when I click on Yes it works but the
signature is still deleted?

Any alternatives to this problem?



"JP" wrote:

Try

.Body = "Hello?" & .Body



HTH,
JP

On Jan 22, 9:08 pm, Gabe wrote:
Hello,

I am pretty new at this but, how do you insert standard text into a new
e-mail message without deleting the default signature? I am using the
following code:

Sub Macro1()
Set OutLk = CreateObject("Outlook.Application")
Set Email = OutLk.CreateItem(0)
With Email
.To = "
.Subject = "New Message"
.Body = "Hello?"
.Display
End With
Set Email = Nothing
Set OutLk = Nothing
End Sub



  #4  
Old January 23rd 08, 05:32 PM posted to microsoft.public.outlook.program_vba
JP[_3_]
external usenet poster
 
Posts: 201
Default Insert standard text into a new message

You didn't mention the Outlook version. If you want to insert your
signature programmatically

In OL2007: http://www.outlookcode.com/codedetail.aspx?id=1743

Otherwise: http://www.outlookcode.com/codedetail.aspx?id=615


HTH,
JP

On Jan 23, 11:26*am, Gabe wrote:
No, a message box came up that said (A program is trying to access e-mail
addresses you have stored in Outlook. Do you want tp allow this?

If this is unexpected, it may be a virus and you should choose "No".)

So when I click on No it does nothing, when I click on Yes it works but the
signature is still deleted?

Any alternatives to this problem?



"JP" wrote:
Try


.Body = "Hello?" & .Body


HTH,
JP


On Jan 22, 9:08 pm, Gabe wrote:
Hello,


I am pretty new at this but, how do you insert standard text into a new
e-mail message without deleting the default signature? I am using the
following code:


Sub Macro1()
Set OutLk = CreateObject("Outlook.Application")
Set Email = OutLk.CreateItem(0)
With Email
.To = "
.Subject = "New Message"
.Body = "Hello?"
.Display
End With
Set Email = Nothing
Set OutLk = Nothing
End Sub- Hide quoted text -


- Show quoted text -


  #5  
Old January 23rd 08, 05:49 PM posted to microsoft.public.outlook.program_vba
Gabe
external usenet poster
 
Posts: 18
Default Insert standard text into a new message

Sorry about that I am running 2003, I tried all the code in that link but it
doesn't seem to work? Also, is there a way to set a default SigName? Because
I am not the only one who will be using this code...

I am really kinda of new at all this, thank you so much for your help.

"JP" wrote:

You didn't mention the Outlook version. If you want to insert your
signature programmatically

In OL2007: http://www.outlookcode.com/codedetail.aspx?id=1743

Otherwise: http://www.outlookcode.com/codedetail.aspx?id=615


HTH,
JP

On Jan 23, 11:26 am, Gabe wrote:
No, a message box came up that said (A program is trying to access e-mail
addresses you have stored in Outlook. Do you want tp allow this?

If this is unexpected, it may be a virus and you should choose "No".)

So when I click on No it does nothing, when I click on Yes it works but the
signature is still deleted?

Any alternatives to this problem?



"JP" wrote:
Try


.Body = "Hello?" & .Body


HTH,
JP


On Jan 22, 9:08 pm, Gabe wrote:
Hello,


I am pretty new at this but, how do you insert standard text into a new
e-mail message without deleting the default signature? I am using the
following code:


Sub Macro1()
Set OutLk = CreateObject("Outlook.Application")
Set Email = OutLk.CreateItem(0)
With Email
.To = "
.Subject = "New Message"
.Body = "Hello?"
.Display
End With
Set Email = Nothing
Set OutLk = Nothing
End Sub- Hide quoted text -


- Show quoted text -



  #6  
Old January 23rd 08, 06:21 PM posted to microsoft.public.outlook.program_vba
JP[_3_]
external usenet poster
 
Posts: 201
Default Insert standard text into a new message

This code worked for me. I put this code in a standard Outlook module.
You mentioned the security prompt, if you are using this in Outlook
that won't happen. Unfortunately the code changes the formatting of
the signature, a small price to pay.


Sub Macro1()

Dim olApp As Outlook.Application
Dim olMsg As Outlook.MailItem

Set olApp = Outlook.Application
Set olMsg = olApp.CreateItem(olMailItem)

With olMsg
.To = "
.Subject = "Hello world"
.Display
.Body = "Hello, here is my email!" & .Body
End With

Set olMsg = Nothing
Set olApp = Nothing
End Sub


HTH,
JP

On Jan 23, 11:49*am, Gabe wrote:
Sorry about that I am running 2003, I tried all the code in that link but it
doesn't seem to work? Also, is there a way to set a default SigName? Because
I am not the only one who will be using this code...

I am really kinda of new at all this, thank you so much for your help.



  #7  
Old January 23rd 08, 05:44 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Insert standard text into a new message

Where are you writing this macro? In Outlook or another application?

See http://www.outlookcode.com/article.aspx?ID=52 for information on the security prompts.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Gabe" wrote in message ...
No, a message box came up that said (A program is trying to access e-mail
addresses you have stored in Outlook. Do you want tp allow this?

If this is unexpected, it may be a virus and you should choose "No".)

So when I click on No it does nothing, when I click on Yes it works but the
signature is still deleted?

Any alternatives to this problem?



"JP" wrote:

Try

.Body = "Hello?" & .Body



HTH,
JP

On Jan 22, 9:08 pm, Gabe wrote:
Hello,

I am pretty new at this but, how do you insert standard text into a new
e-mail message without deleting the default signature? I am using the
following code:

Sub Macro1()
Set OutLk = CreateObject("Outlook.Application")
Set Email = OutLk.CreateItem(0)
With Email
.To = "
.Subject = "New Message"
.Body = "Hello?"
.Display
End With
Set Email = Nothing
Set OutLk = Nothing
End Sub



  #8  
Old January 23rd 08, 05:54 PM posted to microsoft.public.outlook.program_vba
Gabe
external usenet poster
 
Posts: 18
Default Insert standard text into a new message

Sorry, in Outlook 2003.

"Sue Mosher [MVP-Outlook]" wrote:

Where are you writing this macro? In Outlook or another application?

See http://www.outlookcode.com/article.aspx?ID=52 for information on the security prompts.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Gabe" wrote in message ...
No, a message box came up that said (A program is trying to access e-mail
addresses you have stored in Outlook. Do you want tp allow this?

If this is unexpected, it may be a virus and you should choose "No".)

So when I click on No it does nothing, when I click on Yes it works but the
signature is still deleted?

Any alternatives to this problem?



"JP" wrote:

Try

.Body = "Hello?" & .Body



HTH,
JP

On Jan 22, 9:08 pm, Gabe wrote:
Hello,

I am pretty new at this but, how do you insert standard text into a new
e-mail message without deleting the default signature? I am using the
following code:

Sub Macro1()
Set OutLk = CreateObject("Outlook.Application")
Set Email = OutLk.CreateItem(0)
With Email
.To = "
.Subject = "New Message"
.Body = "Hello?"
.Display
End With
Set Email = Nothing
Set OutLk = Nothing
End Sub



 




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
Standard Text in a new E-Mail Message Bob Miller Outlook and VBA 1 November 7th 07 06:40 AM
Insert 'Standard Text' to a reply message OU_MartynF Outlook and VBA 5 August 1st 07 03:15 PM
using signature to insert a standard letter ppieri Outlook - General Queries 5 May 6th 07 09:19 PM
Adding standard text to outgoing emails C3 Outlook Express 3 October 18th 06 07:39 PM
insert as text (to insert html into email body) Iona Outlook - General Queries 1 July 13th 06 01:10 PM


All times are GMT +1. The time now is 09:13 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.