msoutlook.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Automate attachment selection

 
Post new topic   Reply to topic    msoutlook.org Forum Index -> Outlook Program Forms
Author Message
Padds



Joined: 10 Jan 2008
Posts: 4

PostPosted: Thu Jan 10, 2008 8:12 am    Post subject: Automate attachment selection Reply with quote

I would like to create a form, essentially a newsletter, that will
automatically attach a file from a particular location each time the form is
opened. The contents of the file change, however, the name and path remain
constant.

e.g.
I would like G:\folder1\file1.zip to be attached to a form each time the
form is opened (rather than have the attachment saved along with the form
which would mean that the new data in this file would not be attached after
the form was created).

Is this possible? If so, how do I do it?

Archived from group: microsoft>public>outlook>program_forms
Back to top
View user's profile Send private message
karlman



Joined: 02 Jan 2008
Posts: 17

PostPosted: Fri Jan 11, 2008 5:53 pm    Post subject: Re: Automate attachment selection Reply with quote

On Jan 10, 3:12 am, Padds wrote:
> I would like to create a form, essentially a newsletter, that will
> automatically attach a file from a particular location each time the form is
> opened.  The contents of the file change, however, the name and path remain
> constant.  
>
> e.g.
> I would like G:\folder1\file1.zip to be attached to a form each time the
> form is opened (rather than have the attachment saved along with the form
> which would mean that the new data in this file would not be attached after
> the form was created).  
>
> Is this possible?  If so, how do I do it?  

How about just create a link to the file in the form. The actual file
will not be saved in the form, just the link information on wher it is
located. You could change the file all you wanted as long as it's name
remained the same.

Karl
Back to top
View user's profile Send private message
Padds



Joined: 10 Jan 2008
Posts: 4

PostPosted: Wed Jan 23, 2008 5:19 am    Post subject: Re: Automate attachment selection Reply with quote

This won't work in my situation I'm afraid.

The attachment will be sent to external recipients (I should have specified
that in my original question).

Thank's for your reply though - do you have any more suggestions?

"karlman" wrote:

> On Jan 10, 3:12 am, Padds wrote:
> > I would like to create a form, essentially a newsletter, that will
> > automatically attach a file from a particular location each time the form is
> > opened. The contents of the file change, however, the name and path remain
> > constant.
> >
> > e.g.
> > I would like G:\folder1\file1.zip to be attached to a form each time the
> > form is opened (rather than have the attachment saved along with the form
> > which would mean that the new data in this file would not be attached after
> > the form was created).
> >
> > Is this possible? If so, how do I do it?
>
> How about just create a link to the file in the form. The actual file
> will not be saved in the form, just the link information on wher it is
> located. You could change the file all you wanted as long as it's name
> remained the same.
>
> Karl
>
Back to top
View user's profile Send private message
Sue Mosher [MVP-Outlook]



Joined: 12 Aug 2007
Posts: 656

PostPosted: Wed Jan 23, 2008 2:06 pm    Post subject: Re: Automate attachment selection Reply with quote

An Outlook custom form is not a good solution for this scenario, given that custom forms can cause attachment problems for external recipients.

Instead, you could write a little VBA macro to attach the file.

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


"Padds" wrote in message @microsoft.com...
> This won't work in my situation I'm afraid.
>
> The attachment will be sent to external recipients (I should have specified
> that in my original question).
>
> Thank's for your reply though - do you have any more suggestions?
>
> "karlman" wrote:
>
>> On Jan 10, 3:12 am, Padds wrote:
>> > I would like to create a form, essentially a newsletter, that will
>> > automatically attach a file from a particular location each time the form is
>> > opened. The contents of the file change, however, the name and path remain
>> > constant.
>> >
>> > e.g.
>> > I would like G:\folder1\file1.zip to be attached to a form each time the
>> > form is opened (rather than have the attachment saved along with the form
>> > which would mean that the new data in this file would not be attached after
>> > the form was created).
>> >
>> > Is this possible? If so, how do I do it?
>>
>> How about just create a link to the file in the form. The actual file
>> will not be saved in the form, just the link information on wher it is
>> located. You could change the file all you wanted as long as it's name
>> remained the same.
>>
>> Karl
>>
Back to top
View user's profile Send private message
Padds



Joined: 10 Jan 2008
Posts: 4

PostPosted: Tue Feb 12, 2008 6:58 am    Post subject: Re: Automate attachment selection Reply with quote

VBA Macros don't fall into my area of expertise - could you give me some
pointers on where I should start?

"Sue Mosher [MVP-Outlook]" wrote:

> An Outlook custom form is not a good solution for this scenario, given that custom forms can cause attachment problems for external recipients.
>
> Instead, you could write a little VBA macro to attach the file.
>
> --
> Sue Mosher, Outlook MVP
> Author of Microsoft Outlook 2007 Programming:
> Jumpstart for Power Users and Administrators
> http://www.outlookcode.com/article.aspx?id=54
>
>
> "Padds" wrote in message @microsoft.com...
> > This won't work in my situation I'm afraid.
> >
> > The attachment will be sent to external recipients (I should have specified
> > that in my original question).
> >
> > Thank's for your reply though - do you have any more suggestions?
> >
> > "karlman" wrote:
> >
> >> On Jan 10, 3:12 am, Padds wrote:
> >> > I would like to create a form, essentially a newsletter, that will
> >> > automatically attach a file from a particular location each time the form is
> >> > opened. The contents of the file change, however, the name and path remain
> >> > constant.
> >> >
> >> > e.g.
> >> > I would like G:\folder1\file1.zip to be attached to a form each time the
> >> > form is opened (rather than have the attachment saved along with the form
> >> > which would mean that the new data in this file would not be attached after
> >> > the form was created).
> >> >
> >> > Is this possible? If so, how do I do it?
> >>
> >> How about just create a link to the file in the form. The actual file
> >> will not be saved in the form, just the link information on wher it is
> >> located. You could change the file all you wanted as long as it's name
> >> remained the same.
> >>
> >> Karl
> >>
>
Back to top
View user's profile Send private message
Sue Mosher [MVP-Outlook]



Joined: 12 Aug 2007
Posts: 656

PostPosted: Sat Feb 16, 2008 8:22 am    Post subject: Re: Automate attachment selection Reply with quote

Outlook version? Do you use Word as your email editor?

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


"Padds" wrote in message @microsoft.com...
> VBA Macros don't fall into my area of expertise - could you give me some
> pointers on where I should start?
>
> "Sue Mosher [MVP-Outlook]" wrote:
>
>> An Outlook custom form is not a good solution for this scenario, given that custom forms can cause attachment problems for external recipients.
>>
>> Instead, you could write a little VBA macro to attach the file.
>>
>> "Padds" wrote in message @microsoft.com...
>> > This won't work in my situation I'm afraid.
>> >
>> > The attachment will be sent to external recipients (I should have specified
>> > that in my original question).
>> >
>> > Thank's for your reply though - do you have any more suggestions?
>> >
>> > "karlman" wrote:
>> >
>> >> On Jan 10, 3:12 am, Padds wrote:
>> >> > I would like to create a form, essentially a newsletter, that will
>> >> > automatically attach a file from a particular location each time the form is
>> >> > opened. The contents of the file change, however, the name and path remain
>> >> > constant.
>> >> >
>> >> > e.g.
>> >> > I would like G:\folder1\file1.zip to be attached to a form each time the
>> >> > form is opened (rather than have the attachment saved along with the form
>> >> > which would mean that the new data in this file would not be attached after
>> >> > the form was created).
>> >> >
>> >> > Is this possible? If so, how do I do it?
>> >>
>> >> How about just create a link to the file in the form. The actual file
>> >> will not be saved in the form, just the link information on wher it is
>> >> located. You could change the file all you wanted as long as it's name
>> >> remained the same.
>> >>
>> >> Karl
>> >>
>>
Back to top
View user's profile Send private message
Padds



Joined: 10 Jan 2008
Posts: 4

PostPosted: Tue Feb 19, 2008 5:25 pm    Post subject: Re: Automate attachment selection Reply with quote

Outlook 2003 with Word 2003 as the email editor.

"Sue Mosher [MVP-Outlook]" wrote:

> Outlook version? Do you use Word as your email editor?
>
> --
> Sue Mosher, Outlook MVP
> Author of Microsoft Outlook 2007 Programming:
> Jumpstart for Power Users and Administrators
> http://www.outlookcode.com/article.aspx?id=54
>
>
> "Padds" wrote in message @microsoft.com...
> > VBA Macros don't fall into my area of expertise - could you give me some
> > pointers on where I should start?
> >
> > "Sue Mosher [MVP-Outlook]" wrote:
> >
> >> An Outlook custom form is not a good solution for this scenario, given that custom forms can cause attachment problems for external recipients.
> >>
> >> Instead, you could write a little VBA macro to attach the file.
> >>
> >> "Padds" wrote in message @microsoft.com...
> >> > This won't work in my situation I'm afraid.
> >> >
> >> > The attachment will be sent to external recipients (I should have specified
> >> > that in my original question).
> >> >
> >> > Thank's for your reply though - do you have any more suggestions?
> >> >
> >> > "karlman" wrote:
> >> >
> >> >> On Jan 10, 3:12 am, Padds wrote:
> >> >> > I would like to create a form, essentially a newsletter, that will
> >> >> > automatically attach a file from a particular location each time the form is
> >> >> > opened. The contents of the file change, however, the name and path remain
> >> >> > constant.
> >> >> >
> >> >> > e.g.
> >> >> > I would like G:\folder1\file1.zip to be attached to a form each time the
> >> >> > form is opened (rather than have the attachment saved along with the form
> >> >> > which would mean that the new data in this file would not be attached after
> >> >> > the form was created).
> >> >> >
> >> >> > Is this possible? If so, how do I do it?
> >> >>
> >> >> How about just create a link to the file in the form. The actual file
> >> >> will not be saved in the form, just the link information on wher it is
> >> >> located. You could change the file all you wanted as long as it's name
> >> >> remained the same.
> >> >>
> >> >> Karl
> >> >>
> >>
>
Back to top
View user's profile Send private message
Sue Mosher [MVP-Outlook]



Joined: 12 Aug 2007
Posts: 656

PostPosted: Sun Feb 24, 2008 3:07 pm    Post subject: Re: Automate attachment selection Reply with quote

Because Word is your email editor, you would need to create this macro in Word. Insert a new module in the Normal.dot template and put the macro there.

Sub InsertFile()
' requires reference to Microsoft Outlook library
Dim objOL As Outlook.Application
Dim objInsp As Outlook.Inspector
Dim objMail As Outlook.MailItem
On Error Resume Next
Set objOL = GetObject(, "Outlook.Application")
Set objInsp = objOL.ActiveInspector
Set objMail = objInsp.CurrentItem
objMail.Attachments.Add "C:\data\myfile.txt"
Set objMail = Nothing
Set objInsp = Nothing
Set objOL = Nothing
End Sub

You can then run it from an open Outlook message by using Alt+F8 or add a custom toolbar that includes that macro as a button.

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


"Padds" wrote in message @microsoft.com...
> Outlook 2003 with Word 2003 as the email editor.
>
>> > VBA Macros don't fall into my area of expertise - could you give me some
>> > pointers on where I should start?
>> >
>> > "Sue Mosher [MVP-Outlook]" wrote:
>> >
>> >> An Outlook custom form is not a good solution for this scenario, given that custom forms can cause attachment problems for external recipients.
>> >>
>> >> Instead, you could write a little VBA macro to attach the file.
>> >>
>> >> "Padds" wrote in message @microsoft.com...
>> >> > This won't work in my situation I'm afraid.
>> >> >
>> >> > The attachment will be sent to external recipients (I should have specified
>> >> > that in my original question).
>> >> >
>> >> > Thank's for your reply though - do you have any more suggestions?
>> >> >
>> >> > "karlman" wrote:
>> >> >
>> >> >> On Jan 10, 3:12 am, Padds wrote:
>> >> >> > I would like to create a form, essentially a newsletter, that will
>> >> >> > automatically attach a file from a particular location each time the form is
>> >> >> > opened. The contents of the file change, however, the name and path remain
>> >> >> > constant.
>> >> >> >
>> >> >> > e.g.
>> >> >> > I would like G:\folder1\file1.zip to be attached to a form each time the
>> >> >> > form is opened (rather than have the attachment saved along with the form
>> >> >> > which would mean that the new data in this file would not be attached after
>> >> >> > the form was created).
>> >> >> >
>> >> >> > Is this possible? If so, how do I do it?
>> >> >>
>> >> >> How about just create a link to the file in the form. The actual file
>> >> >> will not be saved in the form, just the link information on wher it is
>> >> >> located. You could change the file all you wanted as long as it's name
>> >> >> remained the same.
>> >> >>
>> >> >> Karl
>> >> >>
>> >>
>>

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Custom Form - Insert File Attachment Automatically Hello, I've created a new Form based on the standard email message in Outlook 2002. What I want to do is when I send a new message based on this form, it looks for a file in a folder with the current date and attach it to the email message. I've tried sel

Attachment Box I have a form, two tabs. First tab is message, but not displayed. Second tab is the working form. I added a message field and made small enough not to be seen when the form runs. I did this just to get the paperclip to show so I can attach a document. The

OutLook Attachment This is probably an Outlook question, but maybe someone can help be out here. (I am using VBA to sent e-mails from a Access program). I create an e-mail object MyMail. I then set an attachment: filename, olByValue, 1, "My Name" My p

Automate Outlook username and server Is there any way of setting Outlook to use the same serve name and making it pick up the username automatically (eg %USERNAME%). This way when I image a new PC I won't have to setup Outlook for every user? Thanks for your help, Sam.

How can I automate Send/Receive my 7 eMail accounts in Outlo Hi everyone, my subject is self explanatory, and the background is this: I am away from my system for prolonged durations, from time to time, and I don't want to lose any eMail content in my 7 eMail accounts held by my ISP. I run NT4 SP6a, on a dual P166
Post new topic   Reply to topic    msoutlook.org Forum Index -> Outlook Program Forms All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot 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


Powered by phpBB © 2001, 2005 phpBB Group