Stil unable to use Macro

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

Guest

Hi, thanks for all the help but no solution I have been given is working.
Simply put...I need a macro that will automatically type out 5 sentences of
text plus the signature whilist a new email is open.

for instance

- vblsalsadjlkasjdfsdjsdjfsldjfsldjf. asdjfasdkfhasdlkfhasd

- sldkjfsldfjs;dlfjn nd;lfnsad;lfnn. asfkjaslj;lkjaslkj;lAKSJLJ;J;LLSD

- slkdfs;ldkfjsa;ld - adslfkjs;dlfjas;dlk. adklj, aslkdfj,al;sdkj

SIgnature

Can it be done?
 
If your signature isn't included, it is probably because you do not have
Outlook configured to automatically add it when you create a new message.
Otherwise, you have to add it manually. You can do this in two ways
programmatically:

1) Automate clicking the Insert ->Signature command button:

Sub InsertSpecificSignature(SignatureName As String)
On Error Resume Next

Dim objSignatureMenu As Office.CommandBarPopup
Dim objSigButton As Office.CommandBarButton
Dim objInsp As Outlook.Inspector, objItem As Object

If SignatureName = "" Then Exit Sub

Set objInsp = ActiveInspector

If objInsp Is Nothing Then Exit Sub

Set objSignatureMenu = objInsp.CommandBars.FindControl(, 31145)

If objSignatureMenu Is Nothing Then Exit Sub

Set objSigButton = objSignatureMenu.Controls.Item(SignatureName)

If objSigButton Is Nothing Then Exit Sub

Set objItem = objInsp.CurrentItem

objItem.Body = ""
objSigButton.Execute
End Sub

2) Insert a signature from the files in your user folder that are created
when you create the signature in Outlook (requires a reference to the
Microsoft Scripting Runtime Library):

Function GetSignatureText() As String
Dim objFS As New Scripting.FileSystemObject, objTS As Scripting.TextStream
Dim objF As Scripting.Folder, strSysDrive As String
Dim strUserName As String, strSigText As String

Set objF = objFS.GetSpecialFolder(0)
strSysDrive = Left(objF, 1)
strUserName = FindUserName
Set objTS = objFS.OpenTextFile(strSysDrive & ":\Documents and Settings\"
& strUserName & "\Application Data\Microsoft\Signatures\Work.txt" _
, ForReading, False)
strSigText = objTS.ReadAll
End Function
 
yeah thats good but the signature is really immeaterial
what I want is to how to programatically have poiunt form text entered intot
he email by macro
 
If you want the bulleted or number formatting types provided by Rich Text
e-mails, the only way to do this with code is by using the SafeInspector
object provided by a third party programming tool called Redemption
(http://www.dimastr.com), or by using Word as your e-mail editor and using
the Word object model to format the text.

Otherwise, with HTML e-mails, you can pass a string containing HTML
formatting code (using <UL> or whatever tags for lists, etc.) to the HTMLBody
property of the MailItem object.

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/
 
Back
Top