Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / June 2006

Tip: Looking for answers? Try searching our database.

AutoExec Macro for an .oft file?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jack G - 29 Jun 2006 20:06 GMT
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
Eric Legault [MVP - Outlook] - 29 Jun 2006 21:01 GMT
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-us/vbaol11/html/olconAutomatingOutlookFromO
therMicrosoftOfficeApplications_HV05273034.asp?frame=true


Signature

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

> 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
[quoted text clipped - 10 lines]
>
> JackG
Sue Mosher [MVP-Outlook] - 29 Jun 2006 21:10 GMT
.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.

Signature

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
 

> 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
[quoted text clipped - 14 lines]
>>
>> JackG
Eric Legault [MVP - Outlook] - 30 Jun 2006 15:11 GMT
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.

Signature

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/

> ..oft files don't run code unless the Exchange administrator expressly allows that, which is very, very unlikely.
>
[quoted text clipped - 18 lines]
> >>
> >> JackG
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.