<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Message</TITLE>
<META content="MSHTML 5.00.3314.2100" name=GENERATOR>
<STYLE>@font-face {
font-family: Tahoma;
}
P.MsoNormal {
FONT-FAMILY: "Times New Roman"; FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt
}
LI.MsoNormal {
FONT-FAMILY: "Times New Roman"; FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt
}
DIV.MsoNormal {
FONT-FAMILY: "Times New Roman"; FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt
}
H2 {
FONT-FAMILY: Arial; FONT-SIZE: 14pt; FONT-STYLE: italic; FONT-WEIGHT: bold; MARGIN: 12pt 0cm 3pt
}
H3 {
FONT-FAMILY: Arial; FONT-SIZE: 13pt; FONT-WEIGHT: bold; MARGIN: 12pt 0cm 3pt
}
H4 {
FONT-FAMILY: Arial; FONT-SIZE: 12pt; FONT-WEIGHT: bold; MARGIN: 3pt 0cm
}
A:link {
COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline
}
P {
FONT-FAMILY: "Times New Roman"; FONT-SIZE: 12pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 0cm
}
P.Code {
FONT-FAMILY: "Courier New"; FONT-SIZE: 12pt; MARGIN: 6pt 0cm 6pt 17.85pt; punctuation-wrap: simple
}
LI.Code {
FONT-FAMILY: "Courier New"; FONT-SIZE: 12pt; MARGIN: 6pt 0cm 6pt 17.85pt; punctuation-wrap: simple
}
DIV.Code {
FONT-FAMILY: "Courier New"; FONT-SIZE: 12pt; MARGIN: 6pt 0cm 6pt 17.85pt; punctuation-wrap: simple
}
P.code0 {
FONT-FAMILY: "Courier New"; FONT-SIZE: 12pt; MARGIN: 6pt 0cm 6pt 17.85pt; punctuation-wrap: simple
}
LI.code0 {
FONT-FAMILY: "Courier New"; FONT-SIZE: 12pt; MARGIN: 6pt 0cm 6pt 17.85pt; punctuation-wrap: simple
}
DIV.code0 {
FONT-FAMILY: "Courier New"; FONT-SIZE: 12pt; MARGIN: 6pt 0cm 6pt 17.85pt; punctuation-wrap: simple
}
SPAN.emailstyle19 {
COLOR: navy; FONT-FAMILY: Arial
}
SPAN.EmailStyle21 {
COLOR: navy; FONT-FAMILY: Arial
}
DIV.Section1 {
page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US link=blue vLink=purple>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=760151716-13032003>I get
User defined type not defined Error on: Dim fso As
FileSystemObject</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=760151716-13032003></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=760151716-13032003>This
is in 97, does that make a difference?</SPAN></FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV align=left class=OutlookMessageHeader dir=ltr><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Mike and Doris Manning
[mailto:mikedorism@ntelos.net]<BR><B>Sent:</B> Thursday, March 13, 2003 10:03
AM<BR><B>To:</B> accessd@databaseadvisors.com<BR><B>Subject:</B> RE: [AccessD]
Adding Attachments<BR><BR></DIV></FONT>
<DIV><SPAN class=906185715-13032003><FONT color=#0000ff face=Arial size=2>You
have to do a FileCopy from the first selected location to the second selected
location in order to actually move the file.</FONT></SPAN></DIV>
<DIV><SPAN class=906185715-13032003><FONT color=#0000ff face=Arial
size=2><BR>Public Sub MoveFile(strOldPath As String, strOldName As String,
_<BR>
strNewPath As String, strNewName As
String)<BR>
<BR> On Error GoTo ErrorHandler<BR>
<BR> Dim fso As FileSystemObject<BR> Dim
strOldFile As
String<BR>
<BR> DoCmd.Hourglass True<BR>
<BR> strOldFile = strOldPath &
strOldName<BR> <BR> If Dir(strNewPath,
vbDirectory) = "" Then<BR> Set fso =
New FileSystemObject<BR>
fso.CreateFolder strNewPath<BR> End If<BR>
<BR> FileCopy strOldFile,
strNewName<BR>
<BR> DoCmd.Hourglass False<BR>
<BR> Exit Sub<BR>
<BR>ErrorHandler:<BR> Call HandleErrors(Err, strMyName,
"MoveFile")<BR>End Sub<BR></DIV>
<DIV>
<DIV align=left><FONT face=Arial size=2>Doris Manning</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>Database Administrator</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>Hargrove Inc.</FONT></DIV>
<DIV align=left><FONT color=#0000ff face=Arial
size=2><U>www.hargroveinc.com</U></FONT></DIV></DIV></FONT></SPAN>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV align=left class=OutlookMessageHeader dir=ltr lang=en-us><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
accessd-admin@databaseadvisors.com
[mailto:accessd-admin@databaseadvisors.com] <B>On Behalf Of
</B>Hollis,Virginia<BR><B>Sent:</B> Thursday, March 13, 2003 10:29
AM<BR><B>To:</B> 'accessd@databaseadvisors.com'<BR><B>Subject:</B> RE:
[AccessD] Adding Attachments<BR><BR></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=940541715-13032003>I
have been playing around with the dialog to Save the file to a
specified folder. Tell me if anyone thinks this will
work...</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=940541715-13032003></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=940541715-13032003>Use the Open file dialog so the user can select the
file they need to attach. Then the Save dialog box opens to the directory
& folder where the attachment needs to be
saved.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=940541715-13032003></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=940541715-13032003>Once they save the file it places the file name in
the field 'attachments' which is a hyperlink field.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=940541715-13032003></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=940541715-13032003>Now, the problem... (there's always a
catch)</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=940541715-13032003></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=940541715-13032003>How do I make the Save dialog box actually "Save"
the file?! </SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=940541715-13032003></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=940541715-13032003>The Save dialog opens, and places the file name in
the attachments field, but it does not Save the file to the folder &
directory.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=940541715-13032003></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=940541715-13032003>Virginia</SPAN></FONT></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV align=left class=OutlookMessageHeader dir=ltr><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Wortz, Charles
[mailto:CWortz@tea.state.tx.us]<BR><B>Sent:</B> Wednesday, March 12, 2003
1:38 PM<BR><B>To:</B> accessd@databaseadvisors.com<BR><B>Subject:</B> RE:
[AccessD] Adding Attachments<BR><BR></DIV></FONT>
<DIV><SPAN class=803403419-12032003><FONT color=#0000ff
size=2>Virginia,</FONT></SPAN></DIV>
<DIV><SPAN class=803403419-12032003><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=803403419-12032003><FONT color=#0000ff size=2>If I was
doing it I would add code that checks the path name and reject all path
names that start with a drive letter and only accept UNC path names.
Thus, the only drives on their computers that pass are shared
drives.</FONT></SPAN></DIV>
<DIV> </DIV><!-- Converted from text/rtf format -->
<P><SPAN lang=en-us><B><FONT color=#0000ff face=Arial>Charles
Wortz</FONT></B></SPAN> <BR><SPAN lang=en-us><FONT color=#0000ff
face=Arial>Software Development Division</FONT></SPAN> <BR><SPAN
lang=en-us><FONT color=#0000ff face=Arial>Texas Education
Agency</FONT></SPAN> <BR><SPAN lang=en-us><FONT color=#0000ff
face=Arial>1701 N. Congress Ave</FONT></SPAN> <BR><SPAN lang=en-us><FONT
color=#0000ff face=Arial>Austin, TX 78701-1494</FONT></SPAN> <BR><SPAN
lang=en-us><FONT color=#0000ff face=Arial>512-463-9493</FONT></SPAN>
<BR><SPAN lang=en-us><FONT color=#0000ff
face=Arial>CWortz@tea.state.tx.us</FONT></SPAN> </P>
<DIV></DIV>
<DIV align=left class=OutlookMessageHeader dir=ltr lang=en-us><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
Hollis,Virginia [mailto:HollisVJ@pgdp.usec.com] <BR><B>Sent:</B> Wednesday
2003 Mar 12 13:16<BR><B>To:</B>
'accessd@databaseadvisors.com'<BR><B>Subject:</B> RE: [AccessD] Adding
Attachments<BR><BR></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=930540919-12032003>Is there a way to have the attachment saved
(moved?) to a common network drive, or the directory the database is
stored?</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=930540919-12032003></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=930540919-12032003>I got to thinking, there will be the user that
will attach a file that is stored on their computer, which obviously will
make it unavailable to everyone that needs the
attachment.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=930540919-12032003></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=930540919-12032003>Virginia</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=930540919-12032003></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=930540919-12032003></SPAN></FONT> </DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV align=left class=OutlookMessageHeader dir=ltr><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Arthur Fuller
[mailto:artful@rogers.com]<BR><B>Sent:</B> Wednesday, March 12, 2003
7:09 AM<BR><B>To:</B> accessd@databaseadvisors.com<BR><B>Subject:</B>
RE: [AccessD] Adding Attachments<BR><BR></DIV></FONT>
<DIV class=Section1>
<P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">On my forms I
have the text field beside a little button whose text is just 3 dots.
The OnClick fires the code I posted. The user navigates to a file and
selects ok, then the code plugs the complete filename into the text
field (in this case BigImagePath).</SPAN></FONT></P>
<P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT face=Tahoma
size=2><SPAN style="FONT-FAMILY: Tahoma; FONT-SIZE: 10pt">-----Original
Message-----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B>
accessd-admin@databaseadvisors.com
[mailto:accessd-admin@databaseadvisors.com] <B><SPAN
style="FONT-WEIGHT: bold">On Behalf Of
</SPAN></B>Hollis,Virginia<BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> March 11, 2003 12:34
PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B>
'accessd@databaseadvisors.com'<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [AccessD] Adding
Attachments</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=blue face=Arial
size=2><SPAN
style="COLOR: blue; FONT-FAMILY: Arial; FONT-SIZE: 10pt">Ok, I found Sub
TestGetFileName() in ADH.</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=blue face=Arial
size=2><SPAN
style="COLOR: blue; FONT-FAMILY: Arial; FONT-SIZE: 10pt">You mentioned
posting the results to a control. Do I need to have a button on the form
that opens the GetFileName? Then what transfers this file name to the
field?</SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT
face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
<DIV>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=blue face=Arial
size=2><SPAN
style="COLOR: blue; FONT-FAMILY: Arial; FONT-SIZE: 10pt">Virginia</SPAN></FONT></P></DIV>
<BLOCKQUOTE
style="MARGIN-BOTTOM: 5pt; MARGIN-RIGHT: 0cm; MARGIN-TOP: 5pt">
<P class=MsoNormal
style="MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 36pt; MARGIN-RIGHT: 0cm"><FONT
face=Tahoma size=2><SPAN
style="FONT-FAMILY: Tahoma; FONT-SIZE: 10pt">-----Original
Message-----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B>
Arthur Fuller [mailto:artful@rogers.com]<BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tuesday, March 11, 2003
10:20 AM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B>
accessd@databaseadvisors.com<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [AccessD] Adding
Attachments</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">You don’t
need to use URLs if you don’t want to. I use code from ADH that calls
the Windows API to open the GetFile dialog, then posts the result to a
control on my form, like so:</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">
With Me</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">
.BigImagePath = ahtCommonFileOpenSave()</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">
End With</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">To cohere to
the licensing I cannot post said function or its API declaration. Of
course I could change all the variable names and the function name and
claim it as my own work, which is how I learned to program, but now
that I’m an old fart I don’t do that any more.</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">(Fuller’s Law
#3: You start out a Young Turk and before you know it you’re an Old
Fart.)</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">The function
called above returns an absolute path, but given same and knowledge of
the app directory, it’s a simple matter to replace the app path with a
relative reference. The Replace function does it in one
line:</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">
Replace( strExp as String, strFind as String, strReplace as String
)</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"></SPAN></FONT> </P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">HTH,</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=navy
face=Arial size=2><SPAN
style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">A.</SPAN></FONT></P></BLOCKQUOTE></DIV></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>