Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert text file into BODY of email not as attachment

Status
Not open for further replies.

rdjmorgan

Programmer
Jan 31, 2002
11
GB

Previously in Outlook 2003 we were able to use Word VBA to insertfiles into the body of an email. But this was because Outlook used Word as it's editor.

Now 2010 doesn't allow this yet I would still like to be able to do this.

The VBA i used previously was as follows:

It is run from a form (this was controlled by a keyboard shortcut)
Code:
Global Const varUSERTEXT As String = "w:\zzword97\usertext\"


Sub UserText()
frmUserText.Show
End Sub

Sub GeneralUsertextClauses()
Dim strfilename As String
'Dim oDoc As Word.Document
Dim wd As Word.Application
Dim Doc As Word.Document
Dim fDialog As FileDialog
Dim vrtSelectedItem As Variant
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
With fDialog
    .Title = "Select Text Segment File"
    .InitialFileName = varUSERTEXT
    .Filters.Add "Word Documents", "*.doc", 1
    .AllowMultiSelect = False
    If .Show <> -1 Then
        MsgBox "cancelled by User", , "List Folder Contents"
        Exit Sub
    End If
    strfilename = .SelectedItems(1)
End With
Selection.InsertFile strfilename, Range:="", ConfirmConversions:=False, link:=False, attachment:=False
End Sub

Is there anyway to do this in Outlook 2010 it is so useful to us

Many thanks for your help

Jane
 
For VBA questions, post here:
forum707


"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top