![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Warning: YOu should not be using a published custom form for routine email
messages to external recipients. An .oft file would be better in your scenario. Thank You. Is there a way change my Form to an .oft file. I originally created the e-mail in Outlook with all the graphics. Then I sent it to my self which allowed me to open it then to go Tools-Forms-Publish Form. I am not and Outlook guru and could not figure out how to save my message as a template or even how to copy my message into a new template. (.oft files are templates, right?) The bottom line is this: I just want this message/form/template to be opened instead of a blank email message when I open Outlook from MS Access using VBA code. Question: If I can figure out how to change my form to a template can I use the following VBA code in my Access Module. ----------------- Public Function SendEMail(RecipientTo As String) Dim objOutlook As Outlook.Application Dim objOutlookRecip As Outlook.Recipient Dim objOutlookmsg As Outlook.MailItem Dim MyItem As Outlook.MailItem Set objOutlook = CreateObject("Outlook.Application") Set MyItem = myOlApp.CreateItemFromTemplate("C:\filename.oft") With MyItem Set objOutlookRecip = .Recipients.Add(RecipientTo) objOutlookRecip.Type = olTo .Subject = "My Subject" For Each objOutlookRecip In .Recipients objOutlookRecip.Resolve Next .Display End With Set objOutlook = Nothing End Function -------------------------- Again, Thank You, Thank You, Thank You for your response "Sue Mosher [MVP-Outlook]" wrote: To create a new instance of a custom form programmatically, use the Add method on the target folder's Items collection: Set newItem = targetFolder.Items.Add("IPM.Post.YourFormName") If it's a message form, use the Drafts folder as the target. If the target is a default folder, you can use the Namespace.GetDefaultFolder method to return it as a MAPIFolder object. To create an item in another person's mailbox, use Namespace.GetSharedDefaultFolder to get the MAPIFolder Otherwise, you can use the code at http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy and return the MAPIFolder corresponding to a given path string. See http://www.outlookcode.com/d/launchform.htm for other ideas. Warning: YOu should not be using a published custom form for routine email messages to external recipients. An .oft file would be better in your scenario. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Lisab" wrote in message ... Please Help! I would like to know the VBA code to open and Outlook form I created that is in the Personal Forms Library. I am currently using Access to send E-mail to people that are stored in my database. I am using the code found in here http://support.microsoft.com/kb/209948/en-us I think I have to change one of the following lines of code to something else that refers to the form. ------------- Set objOutlookMsg = objOutlook.CreateItem(olMailItem) 'Create from Template Set MyItem = myOlApp.CreateItemFromTemplate("C:\filename.oft") ------------ PS. The form is just a basic form letter that does not have any fields. There are graphics on the form and that is why I need to use it instead of creating a new mail message. Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
unable to open default e-mail folders; info store won't open | No Avail | Outlook - Installation | 3 | July 30th 07 01:48 AM |
OUTLOOK 2002 - No Option to Open an Outlook data file under the file open menu. | [email protected] | Outlook - General Queries | 2 | August 6th 06 03:49 AM |
Open outlook with Contact listing Open | steve | Outlook - Using Contacts | 1 | June 27th 06 05:19 PM |
I open Outlook 2003 and two identical windows open--how do I fix? | geowj | Outlook - Installation | 0 | March 12th 06 12:05 AM |
How do I set up outlook express so that messages do open unless I open them. | Nev. | Outlook Express | 2 | February 26th 06 12:49 AM |