473,395 Members | 2,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

code for opening an outlook template

hi,

have a small problem.. trying to build a code in VB (in MS access) where I want:

if value in field A is 1 then it should open a predefined outlook template (template 1 ) stored on for example C:\my_database\templates\

If value in field A is 2 then it should open template 2 from the same location

I´ve got 4 different templates...
any idea how to write the code correctly?

thanks & regards
G
Oct 10 '07 #1
1 9937
nico5038
3,080 Expert 2GB
The basic code can be found at:
http://www.daniweb.com/forums/thread35424.html

The crucial line for you is:
Set myItem = myOlApp.CreateItemFromTemplate("C:\Program Files\Microsoft Office\Templates\APPT2.oft")

The string can be made "dynamic" by using the value from the variable (being 1 to 4) like:

Set myItem = myOlApp.CreateItemFromTemplate("C:\my_database\tem plates\template " & Me.A & ".oft")

Nic;o)
Oct 10 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: CReds | last post by:
OK, I am little down right now. We have spent the better part of six months getting our website programmed and tested. We finally went live last week. This week, we get a e-mail from another...
2
by: Lauren Quantrell | last post by:
Using Outlook Automation, is there a way to insert a graphic in the body of an e-mail so that it appears at the top of an email? lq
10
by: John | last post by:
Hi When I open a new outlook email from vb.net, sometimes outlook is very slow to appear or occasionally outlook freezes completely. I am targeting mixed office2000/xp environments so I am...
2
by: lee.ottaway | last post by:
Hi My VB.NET software is simply keeping a reference to certain EML file locations created by Outlook Express. When a user double-clicks a specific EML file from my grid, I'd like Outlook...
1
by: John | last post by:
Hi, I have a question to ask in how to send e-mail through a program written by VB.Net with the help of MS Word and Outlook? The platform will be like this: OS - Win 2K Pro Office 2000 with...
17
by: Liam.M | last post by:
Hey guys, Forgive me if my question my be alittle silly, but I would very much appreciate and assistance that could be given! My situation is as follows: I have created a Button, and set...
1
by: keri | last post by:
Hi, I use the below for the user to view their outlook calendar Sub DisplayInbox() Dim myolApp As Outlook.Application Dim myNameSpace As Outlook.NameSpace Dim myFolder As Outlook.MAPIFolder...
1
by: Marc | last post by:
Hello, Am getting acquainted with VSTO and Visual Studio. I have been really successful adding references to the PIAs for Word, Outlook, Excel, etc. to Console applications and VB applications....
4
by: Alexander Szigetvary | last post by:
Hi NG! Is there a way to open the Outlook address book dialog (as in Outlook) using C#? I am using Outlook 2003 (MS Outlook 11.0 Object Library). In Outlook 2007 it can be done with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.