Macro help please

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I need to create a macro that will automatically enter text in an email.
However the text is 5 sentences long and each sentence must be on a
different line. Also the signature must appear.

ANyone know how?
 
Hi,

calling GetInspector forces to add the sig without displaying the item.

Sub test()
Dim oMail As Outlook.MailItem
Dim oInsp As Outlook.Inspector
Set oMail = Application.CreateItem(olMailItem)
Set oInsp = oMail.GetInspector
oMail.Body = "hallo" & oMail.Body
End Sub
 
It didnt work.
nothign happens


Michael Bauer said:
Hi,

calling GetInspector forces to add the sig without displaying the item.

Sub test()
Dim oMail As Outlook.MailItem
Dim oInsp As Outlook.Inspector
Set oMail = Application.CreateItem(olMailItem)
Set oInsp = oMail.GetInspector
oMail.Body = "hallo" & oMail.Body
End Sub
 
It´s not the solution for your question, but a sample for how to create
a MailItem, write text into etc.

For testing step by step you can set the cursor into the function and
press F8.

For your writing your sentences in different lines you can use vbCRL:
omail.body= "sentence 1" & vbCRLF & "2"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top