def getscan(indir, depth=1, accu=True):
    """
    Get scan of a Microsoft Word file.
    indir is the inputing directory,and depth indicates how deep you want to know.
    e.g.with depth=3, you'll get all the Heading 1, Heading 2 as well as Heading 3 of the file.
    and,if accu is False, you'll get Heading 3 only.
    """
    resu = []
    import docx
    f = docx.Document(indir)
    for i in f.paragraphs:
        if accu == False:
            name_left = 'Heading '
            name_right = str(depth)
            if i.style.name == name_left + name_right:
                resu.append(i.text)
        else:
            j = 1
            for j in range(1, depth + 1):
                name_left = 'Heading '
                name_right = str(j)
                if i.style.name == name_left + name_right:
                    resu.append(i.text)
                    j += 1
    return resu
