![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |