Help!

Outlook 2007 Attachment Position


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA RSS
Next:  Publish to GAL - Can it be done automagically?  
Author Message
mark.t.andrews
External


Since: Aug 06, 2007
Posts: 1



PostPosted: Mon Aug 06, 2007 7:57 am    Post subject: Outlook 2007 Attachment Position
Archived from groups: microsoft>public>outlook>program_vba (more info?)

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
Back to top
Sue Mosher [MVP-Outlook]
External


Since: Feb 11, 2005
Posts: 21627



PostPosted: Mon Aug 06, 2007 11:29 am    Post subject: Re: Outlook 2007 Attachment Position [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Yes, that's one of the known problems I've listed at http://outlookcode.com/article.aspx?id=59

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


<mark.t.andrews RemoveThis @eds.com> wrote in message news:1186412239.557579.154250@x35g2000prf.googlegroups.com...
>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?
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum