A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Name of the attachment gets added automatically to the body of the email



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 8th 08, 11:53 AM posted to microsoft.public.outlook.program_vba
DPM
external usenet poster
 
Posts: 21
Default Name of the attachment gets added automatically to the body of the email

Hi,



I have noticed that the name of the attachment gets added into the body of
the email, eventhough not specified in the body of the email when composing
and sending an email using MSOutlook programmatically.



The email received in InBox,

- Has the actual attachment on top of the email as expected.

- Body gets the name of the attachment, eventhough the detail added to the
mail was only "This is a test email." as follows,

"T 07.04.02 - PlanningPermit.pdf his is a test email."

"07.04.02 - PlanningPermit.pdf" is the name of the attachment

- This happens with MS OutLook 2003 SP3

- This program works fine with MSO 2003 SP2 on another computer.



Please could someone advice on how to get rid of the attachment name getting
added to the body of the email enclosed with and .




  #2  
Old July 8th 08, 02:16 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Name of the attachment gets added automatically to the body of the

Please show the code you're using to create the message.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"DPM" wrote:

Hi,



I have noticed that the name of the attachment gets added into the body of
the email, eventhough not specified in the body of the email when composing
and sending an email using MSOutlook programmatically.



The email received in InBox,

- Has the actual attachment on top of the email as expected.

- Body gets the name of the attachment, eventhough the detail added to the
mail was only "This is a test email." as follows,

"T 07.04.02 - PlanningPermit.pdf his is a test email."

"07.04.02 - PlanningPermit.pdf" is the name of the attachment

- This happens with MS OutLook 2003 SP3

- This program works fine with MSO 2003 SP2 on another computer.



Please could someone advice on how to get rid of the attachment name getting
added to the body of the email enclosed with and .





  #3  
Old July 9th 08, 06:52 AM posted to microsoft.public.outlook.program_vba
DPM
external usenet poster
 
Posts: 21
Default Name of the attachment gets added automatically to the body of the

Hi Sue,

loOutLookSession = CREATEOBJECT('OutLook.Application')
loOutBox = loOutLookSession.GetNameSpace("MAPI").GetDefaultFo lder(4)
loMailItem = loOutBox.Items.Add(0)

loMailItem.Subject = "This is the Subject"
loMailItem.BodyFormat = 1
loMailItem.Body = "This is the Detail"
loMailItem.TO = To recipient

lcAttachment = Name of the attachment
lnAttachmentPosition = loMailItem.Attachments.Count + 1
loMailItem.Attachments.Add(lcAttachment, 1, lnAttachmentPosition, Display
name of the attachment)

loMailItem.Send()



"Sue Mosher [MVP-Outlook]" wrote in message
...

Please show the code you're using to create the message.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"DPM" wrote:

Hi,



I have noticed that the name of the attachment gets added into the body
of
the email, eventhough not specified in the body of the email when
composing
and sending an email using MSOutlook programmatically.



The email received in InBox,

- Has the actual attachment on top of the email as expected.

- Body gets the name of the attachment, eventhough the detail added to
the
mail was only "This is a test email." as follows,

"T 07.04.02 - PlanningPermit.pdf his is a test email."

"07.04.02 - PlanningPermit.pdf" is the name of the attachment

- This happens with MS OutLook 2003 SP3

- This program works fine with MSO 2003 SP2 on another computer.



Please could someone advice on how to get rid of the attachment name
getting
added to the body of the email enclosed with and .







  #4  
Old July 9th 08, 01:29 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Name of the attachment gets added automatically to the body of

Try changing your Attachments.Add statement to:

loMailItem.Attachments.Add(lcAttachment, 1)

Neither the position nor the display name parameters are relevant to a plain
text message with the file attached by value.

You might also try setting Body after you attach the file.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"DPM" wrote:

Hi Sue,

loOutLookSession = CREATEOBJECT('OutLook.Application')
loOutBox = loOutLookSession.GetNameSpace("MAPI").GetDefaultFo lder(4)
loMailItem = loOutBox.Items.Add(0)

loMailItem.Subject = "This is the Subject"
loMailItem.BodyFormat = 1
loMailItem.Body = "This is the Detail"
loMailItem.TO = To recipient

lcAttachment = Name of the attachment
lnAttachmentPosition = loMailItem.Attachments.Count + 1
loMailItem.Attachments.Add(lcAttachment, 1, lnAttachmentPosition, Display
name of the attachment)

loMailItem.Send()



"Sue Mosher [MVP-Outlook]" wrote in message
...

Please show the code you're using to create the message.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"DPM" wrote:

Hi,



I have noticed that the name of the attachment gets added into the body
of
the email, eventhough not specified in the body of the email when
composing
and sending an email using MSOutlook programmatically.



The email received in InBox,

- Has the actual attachment on top of the email as expected.

- Body gets the name of the attachment, eventhough the detail added to
the
mail was only "This is a test email." as follows,

"T 07.04.02 - PlanningPermit.pdf his is a test email."

"07.04.02 - PlanningPermit.pdf" is the name of the attachment

- This happens with MS OutLook 2003 SP3

- This program works fine with MSO 2003 SP2 on another computer.



Please could someone advice on how to get rid of the attachment name
getting
added to the body of the email enclosed with and .


  #5  
Old July 10th 08, 12:38 PM posted to microsoft.public.outlook.program_vba
DPM
external usenet poster
 
Posts: 21
Default Name of the attachment gets added automatically to the body of

Hi Sue,

Thanks, I'll try to see if it works.


"Sue Mosher [MVP-Outlook]" wrote in message
...
Try changing your Attachments.Add statement to:

loMailItem.Attachments.Add(lcAttachment, 1)

Neither the position nor the display name parameters are relevant to a
plain
text message with the file attached by value.

You might also try setting Body after you attach the file.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"DPM" wrote:

Hi Sue,

loOutLookSession = CREATEOBJECT('OutLook.Application')
loOutBox = loOutLookSession.GetNameSpace("MAPI").GetDefaultFo lder(4)
loMailItem = loOutBox.Items.Add(0)

loMailItem.Subject = "This is the Subject"
loMailItem.BodyFormat = 1
loMailItem.Body = "This is the Detail"
loMailItem.TO = To recipient

lcAttachment = Name of the attachment
lnAttachmentPosition = loMailItem.Attachments.Count + 1
loMailItem.Attachments.Add(lcAttachment, 1, lnAttachmentPosition,
Display
name of the attachment)

loMailItem.Send()



"Sue Mosher [MVP-Outlook]" wrote in message
...

Please show the code you're using to create the message.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"DPM" wrote:

Hi,



I have noticed that the name of the attachment gets added into the
body
of
the email, eventhough not specified in the body of the email when
composing
and sending an email using MSOutlook programmatically.



The email received in InBox,

- Has the actual attachment on top of the email as expected.

- Body gets the name of the attachment, eventhough the detail added
to
the
mail was only "This is a test email." as follows,

"T 07.04.02 - PlanningPermit.pdf his is a test email."

"07.04.02 - PlanningPermit.pdf" is the name of the attachment

- This happens with MS OutLook 2003 SP3

- This program works fine with MSO 2003 SP2 on another computer.



Please could someone advice on how to get rid of the attachment name
getting
added to the body of the email enclosed with and .




  #6  
Old July 16th 08, 04:45 AM posted to microsoft.public.outlook.program_vba
DPM
external usenet poster
 
Posts: 21
Default Name of the attachment gets added automatically to the body of

Hi Sue,

Thanks it works.
For this we did not set the index possition of the attachments when the mail
is sent in plain text.


"DPM" wrote in message
...
Hi Sue,

Thanks, I'll try to see if it works.


"Sue Mosher [MVP-Outlook]" wrote in message
...
Try changing your Attachments.Add statement to:

loMailItem.Attachments.Add(lcAttachment, 1)

Neither the position nor the display name parameters are relevant to a
plain
text message with the file attached by value.

You might also try setting Body after you attach the file.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"DPM" wrote:

Hi Sue,

loOutLookSession = CREATEOBJECT('OutLook.Application')
loOutBox = loOutLookSession.GetNameSpace("MAPI").GetDefaultFo lder(4)
loMailItem = loOutBox.Items.Add(0)

loMailItem.Subject = "This is the Subject"
loMailItem.BodyFormat = 1
loMailItem.Body = "This is the Detail"
loMailItem.TO = To recipient

lcAttachment = Name of the attachment
lnAttachmentPosition = loMailItem.Attachments.Count + 1
loMailItem.Attachments.Add(lcAttachment, 1, lnAttachmentPosition,
Display
name of the attachment)

loMailItem.Send()



"Sue Mosher [MVP-Outlook]" wrote in message
...

Please show the code you're using to create the message.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"DPM" wrote:

Hi,



I have noticed that the name of the attachment gets added into the
body
of
the email, eventhough not specified in the body of the email when
composing
and sending an email using MSOutlook programmatically.



The email received in InBox,

- Has the actual attachment on top of the email as expected.

- Body gets the name of the attachment, eventhough the detail added
to
the
mail was only "This is a test email." as follows,

"T 07.04.02 - PlanningPermit.pdf his is a test email."

"07.04.02 - PlanningPermit.pdf" is the name of the attachment

- This happens with MS OutLook 2003 SP3

- This program works fine with MSO 2003 SP2 on another computer.



Please could someone advice on how to get rid of the attachment name
getting
added to the body of the email enclosed with and .






 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Name of the attachment gets added automatically to the body of the email DPM Outlook and VBA 0 July 8th 08 11:54 AM
automatically check if attachment was added when sending message kkappabear Outlook and VBA 3 August 6th 07 01:18 PM
Create email with body and doc attachment ms Outlook and VBA 1 January 18th 07 05:56 AM
How do I stop email contacts from being added automatically? NoCorners Bob Outlook - Using Contacts 4 November 2nd 06 04:25 AM
email addresses automatically added to contacts folder Gumbysgirl4 Outlook - Using Contacts 1 March 13th 06 11:02 PM


All times are GMT +1. The time now is 03:03 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.