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

AutoExec Macro for an .oft file?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 29th 06, 08:06 PM posted to microsoft.public.outlook.program_vba
Jack G
external usenet poster
 
Posts: 4
Default AutoExec Macro for an .oft file?

I'd like to be able to start a new email message using an Office Form
Template (.oft), and have it programatically insert the contents of the
clipboard into the message section of the email as soon as it's opened. Can
the template support an AutoExec macro or something like that to accomplish
this?

The bigger picture is that I'm starting this email from within Access where
I've just saved what I want in the message to the Windows Clipboard. I'm
resorting to this method because I'm wanting the email in HTML format, and
the Access SendObject method only seems to support Plain Text.

Anyone have any ideas?

JackG


Ads
  #2  
Old June 29th 06, 09:01 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default AutoExec Macro for an .oft file?

You need to use VBScript behind your .oft form to interact with the message
body. Unfortunately, there is no direct way to access the Windows clipboard
with VBScript. You'd need to do things as a workaround:

- create a macro in your Outlook VBA project that uses the
MSForms.DataObject (see http://www.cpearson.com/Excel/clipboar.htm for
details)
- call this macro from your Item_Open() function in the code behind the .oft
form (see http://support.microsoft.com/?kbid=221827 for more info)

Otherwise, perhaps you can abandon using SendObject from Access and just
automate Outlook directly to obtain full control over the e-mail you are
creating:

Automating Outlook from other Microsoft Office applications:
http://msdn.microsoft.com/library/en...asp?frame=true

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Jack G" wrote:

I'd like to be able to start a new email message using an Office Form
Template (.oft), and have it programatically insert the contents of the
clipboard into the message section of the email as soon as it's opened. Can
the template support an AutoExec macro or something like that to accomplish
this?

The bigger picture is that I'm starting this email from within Access where
I've just saved what I want in the message to the Windows Clipboard. I'm
resorting to this method because I'm wanting the email in HTML format, and
the Access SendObject method only seems to support Plain Text.

Anyone have any ideas?

JackG



  #3  
Old June 29th 06, 09:10 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default AutoExec Macro for an .oft file?

..oft files don't run code unless the Exchange administrator expressly allows that, which is very, very unlikely.

A published form is needed to run code.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Eric Legault [MVP - Outlook]" wrote in message ...
You need to use VBScript behind your .oft form to interact with the message
body. Unfortunately, there is no direct way to access the Windows clipboard
with VBScript. You'd need to do things as a workaround:



"Jack G" wrote:

I'd like to be able to start a new email message using an Office Form
Template (.oft), and have it programatically insert the contents of the
clipboard into the message section of the email as soon as it's opened. Can
the template support an AutoExec macro or something like that to accomplish
this?

The bigger picture is that I'm starting this email from within Access where
I've just saved what I want in the message to the Windows Clipboard. I'm
resorting to this method because I'm wanting the email in HTML format, and
the Access SendObject method only seems to support Plain Text.

Anyone have any ideas?

JackG



  #4  
Old June 30th 06, 03:11 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default AutoExec Macro for an .oft file?

D'oh! Funny, because I thought that right away when I read his post, but for
some reason I was thinking it's fine if you run the .oft from the file system
rather than an .oft received through e-mail. It's the same darn thing of
course.

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration and
SharePoint Infrastructure)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Sue Mosher [MVP-Outlook]" wrote:

..oft files don't run code unless the Exchange administrator expressly allows that, which is very, very unlikely.

A published form is needed to run code.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Eric Legault [MVP - Outlook]" wrote in message ...
You need to use VBScript behind your .oft form to interact with the message
body. Unfortunately, there is no direct way to access the Windows clipboard
with VBScript. You'd need to do things as a workaround:



"Jack G" wrote:

I'd like to be able to start a new email message using an Office Form
Template (.oft), and have it programatically insert the contents of the
clipboard into the message section of the email as soon as it's opened. Can
the template support an AutoExec macro or something like that to accomplish
this?

The bigger picture is that I'm starting this email from within Access where
I've just saved what I want in the message to the Windows Clipboard. I'm
resorting to this method because I'm wanting the email in HTML format, and
the Access SendObject method only seems to support Plain Text.

Anyone have any ideas?

JackG




 




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
.oft form Eddie Outlook - Using Forms 1 May 3rd 06 08:59 PM
create macro to show file size in outlook john mcmichael Outlook and VBA 3 May 2nd 06 09:55 PM
Custom Form saved as *.oft file not opening correctly in Outlook 2003 [email protected] Outlook - Using Forms 3 April 26th 06 02:50 PM
.oft file? Lykurgos Outlook - General Queries 1 March 4th 06 06:32 PM
Export a .oft mmark75 Outlook - Using Forms 5 January 27th 06 04:09 PM


All times are GMT +1. The time now is 03:52 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.