> 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
[quoted text clipped - 8 lines]
>
> 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
Padds - 23 Jan 2008 08:19 GMT
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?
> > 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
[quoted text clipped - 15 lines]
>
> Karl
Sue Mosher [MVP-Outlook] - 23 Jan 2008 14:06 GMT
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.

Signature
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
> This won't work in my situation I'm afraid.
>
[quoted text clipped - 22 lines]
>>
>> Karl
Padds - 12 Feb 2008 09:58 GMT
VBA Macros don't fall into my area of expertise - could you give me some
pointers on where I should start?
> An Outlook custom form is not a good solution for this scenario, given that custom forms can cause attachment problems for external recipients.
>
[quoted text clipped - 26 lines]
> >>
> >> Karl
Sue Mosher [MVP-Outlook] - 16 Feb 2008 08:22 GMT
Outlook version? Do you use Word as your email editor?

Signature
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
> VBA Macros don't fall into my area of expertise - could you give me some
> pointers on where I should start?
[quoted text clipped - 29 lines]
>> >>
>> >> Karl
Padds - 19 Feb 2008 20:25 GMT
Outlook 2003 with Word 2003 as the email editor.
> Outlook version? Do you use Word as your email editor?
>
[quoted text clipped - 31 lines]
> >> >>
> >> >> Karl
Sue Mosher [MVP-Outlook] - 24 Feb 2008 15:07 GMT
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.

Signature
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
> Outlook 2003 with Word 2003 as the email editor.
>
[quoted text clipped - 31 lines]
>> >> >>
>> >> >> Karl
Marc - 02 May 2008 19:25 GMT
So sorry about this bump but I have been struggling with a similar problem as well. I am trying to attach one Excel file with all my outgoing e-mails. It will be the same Excel file and I am looking to have the attachment already attached to the e-mail when I click on "New" to send a new e-mail.
Is that possible with the VB code suemvp provided above? Much thanks for your help. :blush:
Sue Mosher [MVP-Outlook] - 02 May 2008 21:02 GMT
What code are you referring to? "above" doesn't have a concrete meaning in a discussion forum that can be accessed any number of different ways.
Also, does the Excel file itself change?

Signature
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
> So sorry about this bump but I have been struggling with a similar problem as well. I am trying to attach one Excel file with all my outgoing e-mails. It will be the same Excel file and I am looking to have the attachment already attached to the e-mail when I click on "New" to send a new e-mail.
>
> Is that possible with the VB code suemvp provided above? Much thanks for your help. :blush:
Marc - 02 May 2008 21:15 GMT
Hello,
This is the code I was referring to:
Quote:
> Sub InsertFile()
> ' requires reference to Microsoft Outlook library
[quoted text clipped - 10 lines]
> Set objOL = Nothing
> End Sub
And the Excel file does not change. And it's location (in C drive) does not change either.
Sue Mosher [MVP-Outlook] - 06 May 2008 16:17 GMT
You'd want to use the events related to the Inspector window. Put the following code in the built-in ThisOutlookSession module, then run the Application_Startup procedure.
Dim WithEvents m_colInsp As Outlook.Inspectors
Dim WithEvents m_objInsp As Outlook.Inspector
Private Sub Application_Startup()
Set m_colInsp = Application.Inspectors
End Sub
Private Sub m_colInsp_NewInspector(ByVal Inspector As Inspector)
Set m_objInsp = Inspector
End Sub
Private Sub m_objInsp_Activate()
Dim objMail As Outlook.mailItem
If m_objInsp.CurrentItem.Class = olMail Then
Set objMail = m_objInsp.CurrentItem
If objMail.Size = 0 Then
' it's a new message
objMail.Attachments.Add "C:\Data\myfile.xls"
End If
End If
Set objMail = Nothing
Set m_objInsp = Nothing
End Sub

Signature
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
> Hello,
>
[quoted text clipped - 17 lines]
>
> And the Excel file does not change. And it's location (in C drive) does not change either.
Marc - 15 May 2008 17:03 GMT
Hello suemvp,
Thank you so much for your help. The code works perfectly. I greatly appreciate it for taking your time to help me.
I also managed to learn a few things about using the built-in VB Editor.
Best Regards,
Starbuzz