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"
 
Back
Top