Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

'If exist' code syntax when Custom Form printing via Word template

Posted on 2003-11-11
1
205 Views
Last Modified: 2010-04-08
I have created a custom outlook form and have used the Word template method for printing it.

Within the Outlook form code I can define the template path/filename as e.g. 'strTemplate = "c:\templates\formprn.dot"' and all works OK.

However the word template could be in one of two locations so I would like to try something similar to the following:-

'If exist "c:\templates\formprn.dot" then
   strTemplate = "c:\templates\formprn.dot"
  Else
   strTemplate = "d:\templates\formprn.dot"
End if'

However, above syntax/command structure is incorrect and have been unable to find any sample code.

Can anybody point me in the right direction?

A.  


0
Comment
Question by:arakis
1 Comment
 
LVL 11

Accepted Solution

by:
Steiner earned 350 total points
ID: 9729966
To check wheter a file exists in a specific location, use dir():

If Dir ("C:\templates\formprn.dot") <> "" then msgbox "It exists"
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question