Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook Discussion
Outlook 2007 inserts 2 lines before Signature
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Paradigm, post: 14108677, member: 112504"] For info: I was trying to get a resolution for the issue myself for Outlook (Win 7, Office 2010 & I also had it in XP Professional Office 2003) but after a lot of searching I could not, so not one to give up I modified some code to do the job via VBA in Outlook so that every time you open a New Email Message with a Signature (where Outlook automatically adds in an extra 2 lines) it implicitly deletes those lines. I have added the solution below. Assumptions: you will recode the routine to actually determine new email messages rather than just olMail class but the error trap in the open handler will suffice for a quick fix, I hope this helps someone! Mark Kubiszyn. Put this in the ThisOutlookSession Module: [CODE] Option Explicit ' clsInspector class will remove additional 2 lines from outlook signatures Dim Insp As clsInspector Private Sub Application_Quit(): Set Insp = Nothing: End Sub Private Sub Application_Startup(): Set Insp = New clsInspector: End Sub [/CODE] ...and put this into a new class Module entitled clsInspector: [CODE] Option Explicit Dim WithEvents oAppInspectors As Outlook.Inspectors Dim WithEvents oMailInspector As Outlook.Inspector Dim WithEvents oOpenMail As Outlook.MailItem Private Sub Class_Initialize() Set oAppInspectors = Application.Inspectors End Sub Private Sub oAppInspectors_NewInspector(ByVal Inspector As Inspector) If Inspector.CurrentItem.Class <> olMail Then Exit Sub End If Set oOpenMail = Inspector.CurrentItem Set oMailInspector = Inspector End Sub Private Sub oOpenMail_Open(Cancel As Boolean) On Error GoTo e Const wdStory = 6 Dim objDoc, objSel Set objDoc = oMailInspector.WordEditor Set objSel = objDoc.Windows(1).Selection objSel.Move wdStory, -1 ' start of editor/signature objSel.Delete ' line 1 objSel.Delete ' line 2 e: Exit Sub End Sub Private Sub oOpenMail_Close(Cancel As Boolean) Set oOpenMail = Nothing Set oMailInspector = Nothing End Sub Private Sub Class_Terminate() Set oAppInspectors = Nothing Set oOpenMail = Nothing End Sub [/CODE] [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook Discussion
Outlook 2007 inserts 2 lines before Signature
Top