![]() |
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
|
|||
|
|||
![]()
I am having a problem getting a file attachment to be positioned where
I need it. I am executing code from MS Excel to create an email message in Outlook. In 2003, the position parameter positions my attachment correctly, but so far, I have had no luck getting Outlook to position my attachments where I tell it to. No matter what I put in the position parameter, it puts the attachment after the last character in my body text. The only difference is if I put '1' in the position parameter and the attachment is positioned before the first character of my body text. Is there a known problem with the attachment parameter in Oulook 2007? Here is the code that I am using: With mobjolMail .Subject = gstrEmail_Subject .SentOnBehalfOfName = gstrEmail_Signature_1 .Importance = olImportanceHigh ' Loop through recipients. ' For mintRow_Index = 2 To glngEnd_Row .Recipients.Add (ActiveSheet.Cells(mintRow_Index, 1)) Next mintRow_Index .Body = gstrEmail_Body & _ vbCrLf & vbCrLf & _ " " & _ vbCrLf & vbCrLf & _ gstrEmail_Signature_1 & vbCrLf & _ gstrEmail_Signature_2 mstrReport_Name = Dir(gstrReport_Path & mstrReport_Name_Zip) If mstrReport_Name = vbNullString Then gstrMsg_Text = "The report file: " & mstrReport_Name_Zip & _ ", was not found in the folder: " & gstrReport_Path & _ "." & _ vbLf & vbLf & _ "Verify that the report is correctly coded in the System File " & _ "Workbook, in the Excel App Information Library and that the file " & _ "exists before attempting to create this email message again." MsgBox gstrMsg_Text, vbOKOnly + vbInformation, gcstrMsg_Title Else mintAttachment_Position = Len(gstrEmail_Body) + 3 Do While mstrReport_Name vbNullString .Attachments.Add gstrReport_Path & mstrReport_Name_Zip, olByValue, _ mintAttachment_Position, mstrReport_Name mstrReport_Name = Dir Loop ' Saves the message for later editing in the users "Drafts" Outlook folder. ' .Move mobjolDrafts_Folder mblnEmail_Saved_To_Draft = True End If Set mobjolMail = Nothing End With |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook 2007 attachment | Melissa Little | Outlook - General Queries | 4 | May 24th 07 02:12 PM |
Sending Attachment in outlook 2007 SLOW !! | Carlos | Outlook - General Queries | 1 | May 1st 07 05:34 AM |
How do I sorting contacts in Outlook by position | SoBe | Outlook - Using Contacts | 4 | January 31st 07 04:07 PM |
Outlook opens in the crash position | David Mursch | Outlook - General Queries | 0 | January 31st 07 12:48 PM |
Outlook 2007 Beta2 Attachment Configuration | kyle | Outlook - Installation | 0 | November 8th 06 05:23 PM |