Posts by handclips


    I want to attach all PDFs in a specific desktop folder to an Outlook email using VBA in Word

    I'm using below code to generate an Outlook email but cant figure out how to write the attachment part.

    Sub Email_Template1()

    Dim oMailItem As Object, oOLapp As Object

    Dim Word As Object, doc As Object, MsgTxt$

    Set oOLapp = CreateObject("Outlook.Application")

    Set oMailItem = oOLapp.CreateItem(0)

    Set Word = CreateObject("word.application")

    With oMailItem

    .To = "Email"

    .cc = "Email"

    .subject = "Needed Confirmation"

    ' .attachment.Add

    .HTMLBody = "test"


    End With

    Set oOLapp = Nothing

    Set oMailItem = Nothing

    End Sub

    Hi all

    I want to make a VBA which can help to copy data from ALL word files in a folder to a template file that has preset header and footer.

    For example:

    1) Folder has 12 word files (ie. File1 to File12)

    2) VBA should open File1, copy select all contents and paste into template word file.

    3) Afterwhich, save template word file as PDF in another folder

    4) Pt 1 to 3 should repeat for all files in folder. In this case, since there are 12 word files, there should be 12 PDFs.

    Appreciate if someone can help with this pls? Thanks!! :)


    I need urgent help to do the below filter macro. Would really appreciate if any kind hearted soul can assist!

    I have uploaded a sample sheet for easy reference - this is the end result that I want.

    Tab "Filter" - Contains a list of teams (Can be up to 999 teams) and their members in column B to D (Can be a lot more too). Basically, from Row 2, Team 1 consists of Andy and Marie

    Tab "Raw Data" - Contains a product and the personnel handling the specific product.

    Tab "Sheet X" - I want to do a multiple filter on "Raw Data" Column B to look for all the members of each team. Ie. the filter should filter for Andy and Marie from team 1 and paste the filtered result to Sheet 1. This process will be repeated for all the different teams in tab "Filter." Ideally, Team 1 should go to Sheet 1 and team 2 should go to Sheet 2 etc

    The number of teams can be up to 999.