<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=441454617-02042003><FONT face=Arial color=#0000ff size=2>Try
this, it waits for a shelled process to finish before moving on... (watch for
line wrap)</FONT></SPAN></DIV>
<DIV><SPAN class=441454617-02042003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=441454617-02042003><FONT face=Arial color=#0000ff
size=2>Private Declare Function CreateProcessA Lib "kernel32" (ByVal
lpApplicationName As String, ByVal lpCommandLine As String, ByVal
lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, ByVal
bInheritHandles As Long, ByVal dwCreationFlags As Long, ByVal lpEnvironment As
Long, ByVal lpCurrentDirectory As Long, lpStartupInfo As STARTUPINFO,
lpProcessInformation As PROCESS_INFORMATION) As Long</FONT></SPAN></DIV>
<DIV><SPAN class=441454617-02042003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=441454617-02042003><FONT face=Arial color=#0000ff
size=2>Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal
hHandle As Long, ByVal dwMilliseconds As Long) As Long</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>Private Declare Function CloseHandle
Lib "kernel32" (ByVal hObject As Long) As Long<BR></DIV></FONT>
<DIV><FONT face=Arial color=#0000ff size=2>Private Const NORMAL_PRIORITY_CLASS =
&H20&<BR></DIV></FONT>
<DIV><FONT face=Arial color=#0000ff size=2>Private Type
STARTUPINFO<BR> cb As Long<BR> lpReserved As
String<BR> lpDesktop As String<BR> lpTitle
As String<BR> dwX As Long<BR> dwY As
Long<BR> dwXSize As Long<BR> dwYSize As
Long<BR> dwXCountChars As Long<BR>
dwYCountChars As Long<BR> dwFillAttribute As
Long<BR> dwFlags As Long<BR> wShowWindow As
Integer<BR> cbReserved2 As Integer<BR>
lpReserved2 As Long<BR> hStdInput As
Long<BR> hStdOutput As Long<BR> hStdError As
Long<BR>End Type</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>Private Type
PROCESS_INFORMATION<BR> hProcess As Long<BR>
hThread As Long<BR> dwProcessID As Long<BR>
dwThreadID As Long<BR>End Type</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=441454617-02042003><FONT face=Arial color=#0000ff
size=2>Private Sub ShellAndWait(sCmdLine As String)<BR> Dim lR
As Long 'Return<BR> Dim uProc As
PROCESS_INFORMATION<BR> Dim uStart As
STARTUPINFO<BR> <BR> ' Initialize the STARTUPINFO
structure:<BR> uStart.cb = Len(uStart)<BR>
<BR> ' Start the shelled application:<BR> lR =
CreateProcessA(sCmdLine, vbNullString, 0&, 0&, 1&,
NORMAL_PRIORITY_CLASS, 0&, 0&, uStart, uProc)<BR>
<BR> ' Wait for the shelled application to finish:<BR>
lR = WaitForSingleObject(uProc.hProcess, INFINITE)<BR> lR =
CloseHandle(uProc.hProcess)<BR>End Sub<BR></FONT></SPAN></DIV>
<DIV><SPAN class=441454617-02042003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=441454617-02042003><FONT face=Arial color=#0000ff size=2>Hope
this helps. If anything is missing, let me know. I cut and pasted this from a
project.</FONT></SPAN></DIV>
<DIV><SPAN class=441454617-02042003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=441454617-02042003><FONT face=Arial color=#0000ff
size=2>Scott</DIV></FONT></SPAN>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Mike and Doris Manning
[mailto:mikedorism@ntelos.net]<BR><B>Sent:</B> Wednesday, April 02, 2003 12:45
PM<BR><B>To:</B> accessd@databaseadvisors.com<BR><B>Subject:</B> RE: [AccessD]
Email attachment problem<BR><BR></FONT></DIV>
<DIV><SPAN class=313264217-02042003><FONT face=Arial color=#0000ff
size=2>Sure... I've been trying DoEvents but that hasn't worked. I've
checked the file size after the ".Attachments.Add" line and it shows 64B when
the file size is really 23KB.</FONT></SPAN></DIV>
<DIV><SPAN class=313264217-02042003><FONT face=Arial color=#0000ff size=2>
<BR>Public Function SendSafeEmail(SendTo As String, SendSubj As String,
_<BR>
SendBody As String, SendEdit As Boolean,
_<BR>
Optional SendCC As String,
_<BR>
Optional FilePath As String,
_<BR>
Optional strAttach As
String)<BR>
<BR> On Error GoTo ErrorHandler<BR>
<BR> Dim oMail As Object<BR> Dim oSpace As
Object<BR> Dim oFoldr As Object<BR> Dim
oItem As Object<BR> Dim oSafe As
Object<BR> Dim oRecip As Object<BR> Dim
oDeliver As Object<BR> Dim bolOpen As
Boolean<BR> Dim aryRecip() As String<BR>
Dim intRecip As Integer<BR> Dim aryFileList() As
String<BR> Dim intFilelist As Integer<BR>
Dim strFileName As String<BR> Dim lcv As
Integer<BR> Dim strSMTP As String<BR>
<BR> bolOpen = IsOutlookOpen<BR>
<BR> Set oMail =
CreateObject("Outlook.Application")<BR> Set oSpace =
oMail.GetNamespace("MAPI")<BR> Set oFoldr =
oSpace.GetDefaultFolder(olFolderOutbox)<BR> Set oItem =
oMail.CreateItem(olMailItem)<BR> Set oSafe =
CreateObject("Redemption.SafeMailItem")<BR> oSafe.Item =
oItem</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=313264217-02042003><FONT face=Arial color=#0000ff
size=2> With
oSafe<BR> 'Add the TO
names<BR> If SendTo <>
vbNullString
Then<BR> If
InStr(1, SendTo, ";", vbTextCompare) > 0
Then<BR>
If Right(SendTo, 1) <> ";" Then SendTo = SendTo &
";"<BR>
aryRecip = Split(SendTo,
";")<BR>
intRecip = UBound(aryRecip) -
1<BR>
For lcv = 0 To
intRecip<BR>
.Recipients.Add
aryRecip(lcv)<BR>
Next
lcv<BR>
Erase
aryRecip<BR>
.Recipients.ResolveAll<BR>
Else<BR>
.Recipients.Add
SendTo<BR>
.Recipients.ResolveAll<BR>
End If<BR> End
If<BR> 'Add the CC
names<BR> If SendCC <>
vbNullString
Then<BR> If
InStr(1, SendCC, ";", vbTextCompare) > 0
Then<BR>
If Right(SendTo, 1) <> ";" Then SendTo = SendTo &
";"<BR>
aryRecip = Split(SendCC,
";")<BR>
intRecip = UBound(aryRecip) -
1<BR>
For lcv = 0 To
intRecip<BR>
.Recipients.Add
aryRecip(lcv)<BR>
Next
lcv<BR>
.Recipients.ResolveAll<BR>
Else<BR>
.Recipients.Add
SendCC<BR>
.Recipients.ResolveAll<BR>
End If<BR> End
If<BR> 'Add the rest of the
information<BR> .Subject =
SendSubj<BR> .Body =
SendBody<BR>
<BR> 'Add
Attachments<BR> If strAttach
<> vbNullString
Then<BR> If
InStr(1, strAttach, ";", vbTextCompare) > 0
Then<BR>
If Right(strAttach, 1) <> ";"
Then<BR>
strAttach = strAttach &
";"<BR>
End
If<BR>
aryFileList = Split(strAttach,
";")<BR>
intFilelist = UBound(aryFileList) -
1<BR>
For lcv = 0 To
intFilelist<BR>
strFileName = FilePath &
aryFileList(lcv)<BR>
.Attachments.Add
strFileName<BR>
DoEvents<BR>
Next lcv<BR>
End If<BR> End
If<BR>
DoEvents<BR>
<BR> If SendEdit = True
Then<BR>
DoEvents<BR>
.Save<BR>
DoEvents<BR>
.Display<BR>
Exit Function<BR>
Else<BR>
.Send<BR> End
If<BR> End With<BR> <BR>
Set oDeliver = CreateObject("Redemption.MAPIUtils")<BR>
oDeliver.DeliverNow<BR>
oDeliver.Cleanup<BR> <BR> If bolOpen =
False Then<BR>
oMail.Quit<BR> End If<BR>
<BR> Set oDeliver = Nothing<BR> Set oSafe
= Nothing<BR> Set oItem = Nothing<BR> Set
oFoldr = Nothing<BR> Set oSpace =
Nothing<BR> Set oMail = Nothing<BR>
<BR> Exit Function<BR>
<BR>ErrorHandler:<BR> Call HandleErrors(Err, strMyName,
"SendSafeEmail")<BR>End Function</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=313264217-02042003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
accessd-bounces@databaseadvisors.com
[mailto:accessd-bounces@databaseadvisors.com] <B>On Behalf Of </B>John
Ruff<BR><B>Sent:</B> Wednesday, April 02, 2003 12:35 PM<BR><B>To:</B>
accessd@databaseadvisors.com<BR><B>Subject:</B> RE: [AccessD] Email
attachment problem<BR><BR></FONT></DIV>
<DIV><SPAN class=759293417-02042003><FONT face=Arial color=#0000ff
size=2>Can we see your email code?</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV> </DIV><!-- Converted from text/rtf format -->
<P><B><I><FONT face="Times New Roman" color=#0000ff size=4>John V.
Ruff</FONT><FONT face="Times New Roman" size=4> – </FONT><FONT
face="Times New Roman" color=#008080 size=4>The Eternal Optimist</FONT><FONT
face="Times New Roman" size=4></FONT> <FONT face=Wingdings color=#800080
size=4>J</FONT></I></B> <BR><I><FONT face="Times New Roman">Always Looking
For Contract Opportunities</FONT></I> </P>
<P><B><FONT face="Times New Roman" color=#000080 size=2>“Commit to the Lord
whatever you do,</FONT></B>
<BR><B> <FONT
face="Times New Roman" color=#000080 size=2>and your plans will succeed.”
Proverbs 16:3</FONT></B> </P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
accessd-bounces@databaseadvisors.com
[mailto:accessd-bounces@databaseadvisors.com] <B>On Behalf Of </B>Mike and
Doris Manning<BR><B>Sent:</B> Wednesday, April 02, 2003 9:25
AM<BR><B>To:</B> accessd@databaseadvisors.com<BR><B>Subject:</B> [AccessD]
Email attachment problem<BR><BR></FONT></DIV>
<DIV><SPAN class=682442017-02042003><FONT face=Arial size=2>We have been
working on building our own internal PDF Document Solution using
PDF995. We can get the PDF files to create perfectly exactly where
we want them to. </FONT></SPAN><SPAN class=682442017-02042003><FONT
face=Arial size=2>The problem we now have is with our email code we built
using Redemption.</FONT></SPAN></DIV>
<DIV><SPAN class=682442017-02042003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=682442017-02042003><FONT face=Arial size=2>The PDF
original is 23KB but only 64B of that is making it to the email as an
attachment.</FONT></SPAN></DIV>
<DIV><SPAN class=682442017-02042003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=682442017-02042003><FONT face=Arial size=2>Does anybody
have any thoughts on how we could slow the code down so that the entire
attachment would be added? I'm trying to avoid using a message box,
if at all possible.</FONT></SPAN></DIV>
<DIV> </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 face=Arial color=#0000ff
size=2><U>www.hargroveinc.com</U></FONT></DIV></DIV></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>