none
Extract embeded files from word document (outlook.fileattach) RRS feed

  • Question

  • Hi

    I am tryign to extrct the embeded files from word document using VBA.I am able to save most of the files to the disk expect the embed files with classtypes as "Outlook.Fileattach"

    Here is the sample code

    Public Sub ExtractFiles()

    Dim x As Integer

    Dim countx As Integer

    Dim oleF As OLEFormat

    countx = 0

    For x = 1 To ActiveDocument.InlineShapes.Count

        If (ActiveDocument.InlineShapes(x).Type = 1) Then

            Set oleF = ActiveDocument.InlineShapes(x).OLEFormat       

            If (oleF.ProgID = "Outlook.FileAttach") Then

    '''''''''''Need adivice on how to save the files of this type as i am unable to dected the type of file using -----'-------VBA .Looking @ i have all 3 types of files (doc,ppt,xls) as     {EMBED Outlook.FileAttach }       

    '''''''''''

                 'oleF.ActivateAs classtype:="Word.Document.12"

                 'oleF.Activate

                 oleF.DoVerb VerbIndex:=2

                'Debug.Print oleF.classtype & "" & oleF.Edit oleF.Edit

            End If

           

        End If

       

    Next

    End Sub

    Saturday, January 19, 2013 6:00 AM

All replies