A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

VBA to intercept creation of new messages?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 12th 08, 10:09 AM posted to microsoft.public.outlook.program_vba
xtine
external usenet poster
 
Posts: 7
Default VBA to intercept creation of new messages?

Hi

In Word if I create a macro called FileNew which pops up a message box
then it will override the default file new code.

What is the equivalent of FileNew in Outlook 2007 so that I can
override the default functionality? and which template/where should I
store
it in so that it works every time.

I have tried making a normalemail.dot but although it keeps my styles
it loses any keystrokes I have assigned and the multilevel numbering.

I tried saving the styles as a styleset and that works, but I have to
switch to the styleset manually each time.

I then created an oft file which works, but I can't work out how to
get it to be the default - so I thought maybe I could 'catch' the
FileNew process and call it that way?

Any other ideas on how to set up a default message that has multi-
level numbered styles with keystrokes attached?

Christine
Ads
  #2  
Old May 12th 08, 02:07 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default VBA to intercept creation of new messages?

You will need to have your OFT file published to be able to use it. You can
intercept the Inspectors.NewInspector event and set the MessageClass of the
new item in Inspector.CurrentItem to your custom MessageClass.

For instructions on making a custom form the default form for an item type
look at the Forms pages at www.outlookcode.com.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"xtine" wrote in message
...
Hi

In Word if I create a macro called FileNew which pops up a message box
then it will override the default file new code.

What is the equivalent of FileNew in Outlook 2007 so that I can
override the default functionality? and which template/where should I
store
it in so that it works every time.

I have tried making a normalemail.dot but although it keeps my styles
it loses any keystrokes I have assigned and the multilevel numbering.

I tried saving the styles as a styleset and that works, but I have to
switch to the styleset manually each time.

I then created an oft file which works, but I can't work out how to
get it to be the default - so I thought maybe I could 'catch' the
FileNew process and call it that way?

Any other ideas on how to set up a default message that has multi-
level numbered styles with keystrokes attached?

Christine


  #3  
Old May 12th 08, 03:00 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default VBA to intercept creation of new messages?

And note that it's generally a bad idea to make a custom form the default for all messages, unless you're working in an Exchange environment and have tested to confirm that the server is converting outgoing messages so that they don't carry TNEF content.

Christine, you didn't say what you're actually trying to accomplish with your custom form. Chances are that it can be implemented better with an add-in./

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Ken Slovak - [MVP - Outlook]" wrote in message ...
You will need to have your OFT file published to be able to use it. You can
intercept the Inspectors.NewInspector event and set the MessageClass of the
new item in Inspector.CurrentItem to your custom MessageClass.

For instructions on making a custom form the default form for an item type
look at the Forms pages at www.outlookcode.com.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"xtine" wrote in message
...
Hi

In Word if I create a macro called FileNew which pops up a message box
then it will override the default file new code.

What is the equivalent of FileNew in Outlook 2007 so that I can
override the default functionality? and which template/where should I
store
it in so that it works every time.

I have tried making a normalemail.dot but although it keeps my styles
it loses any keystrokes I have assigned and the multilevel numbering.

I tried saving the styles as a styleset and that works, but I have to
switch to the styleset manually each time.

I then created an oft file which works, but I can't work out how to
get it to be the default - so I thought maybe I could 'catch' the
FileNew process and call it that way?

Any other ideas on how to set up a default message that has multi-
level numbered styles with keystrokes attached?

Christine


  #4  
Old May 12th 08, 11:33 PM posted to microsoft.public.outlook.program_vba
xtine
external usenet poster
 
Posts: 7
Default VBA to intercept creation of new messages?


Christine, you didn't say what you're actually trying to accomplish with your custom form. Chances are that it can be implemented better with an add-in./


Hi

All we are trying to do is to present the users with a default blank
'template' that has a restricted set of styles in it (which happens to
be a multi-level numbered list). This is so that the users can send
an email in the 'house style', using the same keystrokes that they use
in Word 2007 to create documents. There are no fields or anything on
the template - its blank.

As we have not yet rolled out Word 2007 we can change which keystrokes
are used, but to date I haven't managed to get the keystrokes to
'stick' other than using my .oft

Basically I need 5 levels of numbered heading and 5 indented paragraph
styles, all based on a style we have called ParaBase which is Arial
12pt, 12pt after... so not anything 'non standard' there.

We don't want the users to be able to change styleset or to be able to
use all the inbuilt styles - so these need to be 'hidden'.

I have all of this working in my .oft - the problem is that to get to
it the users would need to click several times and they won't do this
- they will just use the default, so they will end up sending out
documents that don't conform to the house numbering styles etc.

Christine




  #5  
Old May 12th 08, 11:58 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default VBA to intercept creation of new messages?

That sounds like it might be a job for Quick Styles in the normalemail.dotm template. See http://turtleflock-ol2007.spaces.liv...E3D8!155.entry

We don't want the users to be able to change styleset or to be able to
use all the inbuilt styles - so these need to be 'hidden'.


I suspect that might be possible only by using an add-in to completely rewrite the formatting portion of the ribbon.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"xtine" wrote in message ...

Christine, you didn't say what you're actually trying to accomplish with your custom form. Chances are that it can be implemented better with an add-in./


Hi

All we are trying to do is to present the users with a default blank
'template' that has a restricted set of styles in it (which happens to
be a multi-level numbered list). This is so that the users can send
an email in the 'house style', using the same keystrokes that they use
in Word 2007 to create documents. There are no fields or anything on
the template - its blank.

As we have not yet rolled out Word 2007 we can change which keystrokes
are used, but to date I haven't managed to get the keystrokes to
'stick' other than using my .oft

Basically I need 5 levels of numbered heading and 5 indented paragraph
styles, all based on a style we have called ParaBase which is Arial
12pt, 12pt after... so not anything 'non standard' there.

We don't want the users to be able to change styleset or to be able to
use all the inbuilt styles - so these need to be 'hidden'.

I have all of this working in my .oft - the problem is that to get to
it the users would need to click several times and they won't do this
- they will just use the default, so they will end up sending out
documents that don't conform to the house numbering styles etc.


  #6  
Old May 13th 08, 07:37 PM posted to microsoft.public.outlook.program_vba
xtine
external usenet poster
 
Posts: 7
Default VBA to intercept creation of new messages?

On May 12, 11:58 pm, "Sue Mosher [MVP-Outlook]"
wrote:
That sounds like it might be a job for Quick Styles in the normalemail.dotm template. Seehttp://turtleflock-ol2007.spaces.live.com/blog/cns!C1013F1F9A99E3D8!1...


Thanks Sue, unfortunately thats what I tried first - and it does show
the user the styles in the style gallery - but they lose their
keystroke and numbering properties - if you open the .dotm in Word its
all hunky dory, but create a new message and you only see the font and
paragraph formatting not the numbers. If you do 'Save as a Style
Set' while you are in Word you can pick the styleset from within
Outlook - but again you have to go looking for it.

I wonder if there is a way of choosing the default StyleSet using a
registry setting?


Christine
  #7  
Old May 13th 08, 07:38 PM posted to microsoft.public.outlook.program_vba
xtine
external usenet poster
 
Posts: 7
Default VBA to intercept creation of new messages?



I suspect that might be possible only by using an add-in to completely rewrite the formatting portion of the ribbon.


This is achievable using the Manage Styles options in Word to restrict
and hid the inbuilt styles - haven't tested yet to see if saving this
in normalemail.dotm carries the restrictions forward to Outlook. I
know it does if you create a new mail based on the .oft.


Christine
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
création outlook Roland[_2_] Outlook Express 1 November 8th 07 02:50 AM
Differentiate between drag & drop email task creation and normal task creation Mohit Add-ins for Outlook 1 April 18th 07 05:54 AM
Profile Creation AndyJ Outlook - General Queries 1 March 23rd 07 01:14 PM
Q: How to Intercept "Send" Button? Kyle Ferrio Outlook and VBA 2 July 1st 06 06:49 PM
Macro Creation Jim Patterson Outlook and VBA 1 February 1st 06 05:23 PM


All times are GMT +1. The time now is 03:37 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.