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

attach file with automation in Outlook



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 12th 07, 09:52 AM posted to microsoft.public.outlook.program_vba
huub van helderen
external usenet poster
 
Posts: 3
Default attach file with automation in Outlook

My program;

#define mailitem 0
oOutLookObject = CreateObject("Outlook.Application")
oEmailItem = oOutLookObject.CreateItem(mailitem)
WITH oEmailItem
])
.Subject = [TEST]
.cc=[ ]
.Importance=1
.Body = [ ] ??????? && here i need to attach a file *.msg or *.dot
ENDWITH
release oEmailItem,oOutLookObject,pcTekst,pcOnderwerp


What's the problem ?

I want to attach a file in outlook with a program, my program works but it's
only send tekst to Outlook. So I think I need another statement in place of
".body"
I need to send files *.msg or Outlook template files.
I looked everywhere, burt I can't find a solution.
So i will be very pleased if someone could help me.
--
huub
Ads
  #2  
Old May 12th 07, 01:25 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default attach file with automation in Outlook

You must not have used the object browser (F2 in VBA) or Outlook developer Help to look this up. If you had, you would have seen the Attachments collection:

.Attachments.Add c:\myfile.msg, 1

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"huub van helderen" wrote in message ...
My program;

#define mailitem 0
oOutLookObject = CreateObject("Outlook.Application")
oEmailItem = oOutLookObject.CreateItem(mailitem)
WITH oEmailItem
])
.Subject = [TEST]
.cc=[ ]
.Importance=1
.Body = [ ] ??????? && here i need to attach a file *.msg or *.dot
ENDWITH
release oEmailItem,oOutLookObject,pcTekst,pcOnderwerp


What's the problem ?

I want to attach a file in outlook with a program, my program works but it's
only send tekst to Outlook. So I think I need another statement in place of
".body"
I need to send files *.msg or Outlook template files.
I looked everywhere, burt I can't find a solution.
So i will be very pleased if someone could help me.
--
huub

  #3  
Old May 14th 07, 10:03 AM posted to microsoft.public.outlook.program_vba
huub van helderen
external usenet poster
 
Posts: 3
Default attach file with automation in Outlook

I,ve seen it, but i don't want to send it as an attatchment but I need a
solution to place a file as contents in the body (JPG MSG or DOT template
file), in other words
I think I need a statement like .bodyinsert or something like that.

Thanks for response

--
huub


"Sue Mosher [MVP-Outlook]" wrote:

You must not have used the object browser (F2 in VBA) or Outlook developer Help to look this up. If you had, you would have seen the Attachments collection:

.Attachments.Add c:\myfile.msg, 1

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"huub van helderen" wrote in message ...
My program;

#define mailitem 0
oOutLookObject = CreateObject("Outlook.Application")
oEmailItem = oOutLookObject.CreateItem(mailitem)
WITH oEmailItem
])
.Subject = [TEST]
.cc=[ ]
.Importance=1
.Body = [ ] ??????? && here i need to attach a file *.msg or *.dot
ENDWITH
release oEmailItem,oOutLookObject,pcTekst,pcOnderwerp


What's the problem ?

I want to attach a file in outlook with a program, my program works but it's
only send tekst to Outlook. So I think I need another statement in place of
".body"
I need to send files *.msg or Outlook template files.
I looked everywhere, burt I can't find a solution.
So i will be very pleased if someone could help me.
--
huub


  #4  
Old May 14th 07, 12:25 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default attach file with automation in Outlook

If you didn't want to send an attachment, then why did you say "I want to attach a file."

The techniques used to insert content from a file into the body of the message vary with the content. For a .jpg image, see http://www.outlookcode.com/d/code/htmlimg.htm. For an .msg file, use the Application.CreateItem from template method. For a .dot Word template, use Word's Application.Documents.Add method to create a new document from the template and then use the technique shown at http://www.outlookcode.com/codedetail.aspx?id=1333 to use that document to create a message body.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"huub van helderen" wrote in message ...
I,ve seen it, but i don't want to send it as an attatchment but I need a
solution to place a file as contents in the body (JPG MSG or DOT template
file), in other words
I think I need a statement like .bodyinsert or something like that.

Thanks for response

--
huub


"Sue Mosher [MVP-Outlook]" wrote:

You must not have used the object browser (F2 in VBA) or Outlook developer Help to look this up. If you had, you would have seen the Attachments collection:

.Attachments.Add c:\myfile.msg, 1



"huub van helderen" wrote in message ...
My program;

#define mailitem 0
oOutLookObject = CreateObject("Outlook.Application")
oEmailItem = oOutLookObject.CreateItem(mailitem)
WITH oEmailItem
])
.Subject = [TEST]
.cc=[ ]
.Importance=1
.Body = [ ] ??????? && here i need to attach a file *.msg or *.dot
ENDWITH
release oEmailItem,oOutLookObject,pcTekst,pcOnderwerp


What's the problem ?

I want to attach a file in outlook with a program, my program works but it's
only send tekst to Outlook. So I think I need another statement in place of
".body"
I need to send files *.msg or Outlook template files.
I looked everywhere, burt I can't find a solution.
So i will be very pleased if someone could help me.
--
huub


  #5  
Old May 15th 07, 09:13 PM posted to microsoft.public.outlook.program_vba
huub van helderen
external usenet poster
 
Posts: 3
Default attach file with automation in Outlook

Sorry Sue, it must be my poor English, but still I thank you for your help.
--
huub


"Sue Mosher [MVP-Outlook]" wrote:

If you didn't want to send an attachment, then why did you say "I want to attach a file."

The techniques used to insert content from a file into the body of the message vary with the content. For a .jpg image, see http://www.outlookcode.com/d/code/htmlimg.htm. For an .msg file, use the Application.CreateItem from template method. For a .dot Word template, use Word's Application.Documents.Add method to create a new document from the template and then use the technique shown at http://www.outlookcode.com/codedetail.aspx?id=1333 to use that document to create a message body.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"huub van helderen" wrote in message ...
I,ve seen it, but i don't want to send it as an attatchment but I need a
solution to place a file as contents in the body (JPG MSG or DOT template
file), in other words
I think I need a statement like .bodyinsert or something like that.

Thanks for response

--
huub


"Sue Mosher [MVP-Outlook]" wrote:

You must not have used the object browser (F2 in VBA) or Outlook developer Help to look this up. If you had, you would have seen the Attachments collection:

.Attachments.Add c:\myfile.msg, 1



"huub van helderen" wrote in message ...
My program;

#define mailitem 0
oOutLookObject = CreateObject("Outlook.Application")
oEmailItem = oOutLookObject.CreateItem(mailitem)
WITH oEmailItem
])
.Subject = [TEST]
.cc=[ ]
.Importance=1
.Body = [ ] ??????? && here i need to attach a file *.msg or *.dot
ENDWITH
release oEmailItem,oOutLookObject,pcTekst,pcOnderwerp


What's the problem ?

I want to attach a file in outlook with a program, my program works but it's
only send tekst to Outlook. So I think I need another statement in place of
".body"
I need to send files *.msg or Outlook template files.
I looked everywhere, burt I can't find a solution.
So i will be very pleased if someone could help me.
--
huub


 




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
Cannot Attach File with Outlook 2007 Rob Schneider Outlook - General Queries 1 April 7th 07 02:14 PM
Attach file vs insert file TOP Outlook - General Queries 2 March 17th 07 01:29 PM
Outlook 2003 attach file very slow, Pls help! Ben Outlook - General Queries 1 October 8th 06 08:39 PM
Problem With File Attach .dat Tom Outlook Express 6 September 17th 06 12:37 AM
How do I attach a file as a shortcut? Christa Outlook - General Queries 2 September 15th 06 10:29 AM


All times are GMT +1. The time now is 05:57 AM.


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.