본문 바로가기
아래아한글 자동화/python+hwp 중급

[QnA] 파이참에서 한/글 API 코드 자동완성을 하고 싶어요!

by 일코 2022. 12. 5.
파이참이나 VSCode에서 코딩을 해보면
자동완성 기능 덕분에 메서드를 빠르게 찾는 등
코드를 쾌적하게 짤 수 있는데,
win32com으로 아래아한글 자동화를 할 때에는
자동완성이나 파라미터 정보 등이 하나도 뜨지 않아서 막막합니다.
좋은 방법이 없을까요?

예. 좋은 방법이 없는 것 같습니다.

솔직히 저도 사실 왜 IDE에서 한/글 API 코드의 자동완성이나 파라미터 정보가 안 뜨는지 잘 모르겠습니다.

아래 예시화면처럼 자동완성을 잘 잡아주면 참 좋을텐데요.

한/글 자동화 코드를 짤 때는 아래처럼 장님 코끼리 만지듯 허우적허우적 코딩하는 게 참 번거롭습니다.

모두 외울 수도 없는 노릇이고 수시로 API문서를 뒤적거리면서 코딩해야 하니까요.

 

그래도 나름 경험적으로 알게 된 몇 가지 팁이 있는데요.

업무자동화 코딩하실 때 도움이 되었으면 좋겠습니다.

1. 파이참 콘솔에서는 메서드나 파라미터 정보가 잘 나타납니다.

한/글 API 코드를 파이참 에디터창이 아닌, 콘솔창에서 입력해보면 자동완성이 대부분 작동합니다.

덕분에 대략의 메서드 이름은 알겠는데 정확히 모르겠다 싶은 경우나,

파라미터 이름을 잘 모를 경우에 콘솔창에서 자동완성이나 파라미터 정보를 이용하면

제법 큰 도움이 됩니다.

아래처럼 콘솔에서 코드의 동작을 테스트해보고

의도대로 작동한다면 에디터창에 붙여넣는 식으로 코딩하면

(당연히 수시로 API를 찾는 것보다는) 큰 도움이 됩니다.

콘솔에서 실행해보고 에디터에 붙여넣기~

 

2. 모듈이 깊을 때, 변수로 묶으면(?) 하위 메서드가 잘 나타납니다.

이게 무슨 뜻인지 장황하게 설명드리는 것보다는, 예를 들어드리면 쉽게 이해하실 것 같습니다.

한/글 메서드 중에,

여러 문서가 동시에 열려 있는 경우, n번째 문서를 편집하려면 아래와 같은 명령어를 입력해야 합니다.

hwp.XHwpDocuments.Item(n).SetActive_XHwpDocument()

또, 현재 커서가 위치하고 있는 페이지 번호를 조회하려면 아래와 같은 코드를 입력해야 합니다.

hwp.XHwpDocuments.Item(0).XHwpDocumentInfo.CurrentPage

비록 한 줄의 코드들이지만 상당히 길어서 외우기도 힘든데요.

이런 코드는 파이참 콘솔에서도 힌트가 나타나지 않습니다.

자동완성이 되지 않음

그런데 아래처럼 변수로 지정하면 코드완성이 또 잘 됩니다. (이유는 잘 모르겠지만요..)

변수로 만들었더니 코드완성이 됩니다.

IDE에 익숙하지 않다면 에디터와 콘솔을 왔다갔다 하는 게 불편하실 수도 있을텐데

파이참에서는 다행히 창의 포커스를 옮기는 간편한 단축키들이 있어서

에디터로 포커스 옮기기 : Esc
콘솔로 포커스 옮기기 : Ctrl-Tab-P(깃 적용 후에는 C로 바뀌고, P는 풀리퀘스트로 변경됨)
터미널로 포커스 옮기기 : Alt-F12
프로젝트탐색창으로 포커스 옮기기 : Alt-1
열린 창 닫지 않고 숨기기 : Shift-Esc

조금만 익숙해지면 콘솔과 에디터를 오가면서 코드를 작성하는 속도가 금방 빨라질 것입니다.

 

3. 타입라이브러리 파일을 자주 활용합니다.

pythonwin에서 MakePy를 통해 생성한 7d2b6f3c~.py 파일을 프로젝트 폴더 안에 넣고 종종 참고하고 있습니다.

2022.12.04 - [아래아한글 자동화/python+hwp 중급] - [QnA] pythonwin.exe로 한/글의 TypeLibrary 생성하기

 

[QnA] pythonwin.exe로 한/글의 TypeLibrary 생성하기

이번 포스팅에서는 아래아한글 자동화 작업 때 메서드 인자명을 확인할 수 있는 타입라이브러리 파일 생성방법을 알려드리겠습니다. 대략 아래와 같이 생긴 파이썬 파일입니다. # -*- coding: mbcs -

martinii.fun

타입라이브러리 파일의 활용 예를 조금만 들어보면,

3-1. hwp 하위의 모든 메서드(파라미터) 및 프로퍼티 목록 조회

제 PC에 생성된 타입라이브러리 파일 기준 9958~10965 라인 사이에

IHwpObject 클래스를 정의하는 코드가 있습니다. 이 클래스 안에 메서드나 프로퍼티가 굉장히 많이 정의되어 있는데

이를 통해 API 문서에 없는, 현재까지 추가된 모든 실행가능한 메서드와 프로퍼티 목록를 조회할 수 있습니다.

직접 열어보시면 더 좋겠지만, 아래에 접은글로 전문을 첨부해 둡니다.

더보기
class IHwpObject(DispatchBaseClass):
    'IHwpObject Interface'
    CLSID = IID('{5E6A8276-CF1C-42B8-BCED-319548B02AF6}')
    coclass_clsid = IID('{2291CF00-64A1-4877-A9B4-68CFE89612D6}')

    def ArcType(self, ArcType=defaultNamedNotOptArg):
        'method ArcType'
        return self._oleobj_.InvokeTypes(30076, LCID, 1, (3, 0), ((8, 1),), ArcType
                                         )

    def AutoNumType(self, autonum=defaultNamedNotOptArg):
        'method AutoNumType'
        return self._oleobj_.InvokeTypes(30057, LCID, 1, (3, 0), ((8, 1),), autonum
                                         )

    def BorderShape(self, BorderType=defaultNamedNotOptArg):
        'method BorderShape'
        return self._oleobj_.InvokeTypes(30047, LCID, 1, (3, 0), ((8, 1),), BorderType
                                         )

    def BreakWordLatin(self, BreakLatinWord=defaultNamedNotOptArg):
        'method BreakWordLatin'
        return self._oleobj_.InvokeTypes(30054, LCID, 1, (3, 0), ((8, 1),), BreakLatinWord
                                         )

    def BrushType(self, BrushType=defaultNamedNotOptArg):
        'method BrushType'
        return self._oleobj_.InvokeTypes(30079, LCID, 1, (3, 0), ((8, 1),), BrushType
                                         )

    def Canonical(self, Canonical=defaultNamedNotOptArg):
        'method Canonical'
        return self._oleobj_.InvokeTypes(30072, LCID, 1, (3, 0), ((8, 1),), Canonical
                                         )

    def CellApply(self, CellApply=defaultNamedNotOptArg):
        'method CellApply'
        return self._oleobj_.InvokeTypes(30062, LCID, 1, (3, 0), ((8, 1),), CellApply
                                         )

    def CharShadowType(self, ShadowType=defaultNamedNotOptArg):
        'method CharShadowType'
        return self._oleobj_.InvokeTypes(30022, LCID, 1, (3, 0), ((8, 1),), ShadowType
                                         )

    def CheckXObject(self, bstring=defaultNamedNotOptArg):
        'method CheckXObject'
        ret = self._oleobj_.InvokeTypes(30091, LCID, 1, (9, 0), ((8, 1),), bstring
                                        )
        if ret is not None:
            ret = Dispatch(ret, 'CheckXObject', None)
        return ret

    def Clear(self, option=defaultNamedNotOptArg):
        'method Clear'
        return self._oleobj_.InvokeTypes(10035, LCID, 1, (24, 0), ((12, 1),), option
                                         )

    def ColDefType(self, ColDefType=defaultNamedNotOptArg):
        'method ColDefType'
        return self._oleobj_.InvokeTypes(30031, LCID, 1, (3, 0), ((8, 1),), ColDefType
                                         )

    def ColLayoutType(self, ColLayoutType=defaultNamedNotOptArg):
        'method ColLayoutType'
        return self._oleobj_.InvokeTypes(30032, LCID, 1, (3, 0), ((8, 1),), ColLayoutType
                                         )

    def ConvertPUAHangulToUnicode(self, Text=defaultNamedNotOptArg):
        'method ConvertPUAHangulToUnicode'
        return self._oleobj_.InvokeTypes(30200, LCID, 1, (3, 0), ((12, 1),), Text
                                         )

    def CreateAction(self, actidstr=defaultNamedNotOptArg):
        'method CreateAction'
        ret = self._oleobj_.InvokeTypes(10031, LCID, 1, (9, 0), ((8, 1),), actidstr
                                        )
        if ret is not None:
            ret = Dispatch(ret, 'CreateAction', None)
        return ret

    def CreateField(self, Direction=defaultNamedNotOptArg, memo=defaultNamedNotOptArg, name=defaultNamedNotOptArg):
        'method CreateField'
        return self._oleobj_.InvokeTypes(10005, LCID, 1, (11, 0), ((8, 1), (12, 1), (12, 1)), Direction
                                         , memo, name)

    def CreateID(self, CreationID=defaultNamedNotOptArg):
        'method CreateID'
        return self._oleobj_.InvokeTypes(30035, LCID, 1, (3, 0), ((8, 1),), CreationID
                                         )

    def CreateMode(self, CreationMode=defaultNamedNotOptArg):
        'method CreateMode'
        return self._oleobj_.InvokeTypes(30034, LCID, 1, (3, 0), ((8, 1),), CreationMode
                                         )

    def CreatePageImage(self, Path=defaultNamedNotOptArg, pgno=defaultNamedNotOptArg, resolution=defaultNamedNotOptArg,
                        depth=defaultNamedNotOptArg
                        , Format=defaultNamedNotOptArg):
        'method CreatePageImage'
        return self._oleobj_.InvokeTypes(10025, LCID, 1, (11, 0), ((8, 1), (12, 1), (12, 1), (12, 1), (12, 1)), Path
                                         , pgno, resolution, depth, Format)

    def CreateSet(self, setidstr=defaultNamedNotOptArg):
        'method CreateSet'
        ret = self._oleobj_.InvokeTypes(30102, LCID, 1, (9, 0), ((8, 1),), setidstr
                                        )
        if ret is not None:
            ret = Dispatch(ret, 'CreateSet', None)
        return ret

    def CrookedSlash(self, CrookedSlash=defaultNamedNotOptArg):
        'method CrookedSlash'
        return self._oleobj_.InvokeTypes(30086, LCID, 1, (3, 0), ((8, 1),), CrookedSlash
                                         )

    def DSMark(self, DiacSymMark=defaultNamedNotOptArg):
        'method DSMark'
        return self._oleobj_.InvokeTypes(30024, LCID, 1, (3, 0), ((8, 1),), DiacSymMark
                                         )

    def DbfCodeType(self, DbfCode=defaultNamedNotOptArg):
        'method DbfCodeType'
        return self._oleobj_.InvokeTypes(30067, LCID, 1, (3, 0), ((8, 1),), DbfCode
                                         )

    def DeleteCtrl(self, ctrl=defaultNamedNotOptArg):
        'method DeleteCtrl'
        return self._oleobj_.InvokeTypes(10033, LCID, 1, (11, 0), ((9, 1),), ctrl
                                         )

    def Delimiter(self, Delimiter=defaultNamedNotOptArg):
        'method Delimiter'
        return self._oleobj_.InvokeTypes(30066, LCID, 1, (3, 0), ((8, 1),), Delimiter
                                         )

    def DrawAspect(self, DrawAspect=defaultNamedNotOptArg):
        'method DrawAspect'
        return self._oleobj_.InvokeTypes(30061, LCID, 1, (3, 0), ((8, 1),), DrawAspect
                                         )

    def DrawFillImage(self, fillimage=defaultNamedNotOptArg):
        'method DrawFillImage'
        return self._oleobj_.InvokeTypes(30014, LCID, 1, (3, 0), ((8, 1),), fillimage
                                         )

    def DrawShadowType(self, ShadowType=defaultNamedNotOptArg):
        'method DrawShadowType'
        return self._oleobj_.InvokeTypes(30015, LCID, 1, (3, 0), ((8, 1),), ShadowType
                                         )

    def Encrypt(self, Encrypt=defaultNamedNotOptArg):
        'method Encrypt'
        return self._oleobj_.InvokeTypes(30074, LCID, 1, (3, 0), ((8, 1),), Encrypt
                                         )

    def EndSize(self, EndSize=defaultNamedNotOptArg):
        'method EndSize'
        return self._oleobj_.InvokeTypes(30012, LCID, 1, (3, 0), ((8, 1),), EndSize
                                         )

    def EndStyle(self, EndStyle=defaultNamedNotOptArg):
        'method EndStyle'
        return self._oleobj_.InvokeTypes(30011, LCID, 1, (3, 0), ((8, 1),), EndStyle
                                         )

    def ExportStyle(self, param=defaultNamedNotOptArg):
        'method ExportStyle'
        return self._oleobj_.InvokeTypes(30001, LCID, 1, (11, 0), ((9, 1),), param
                                         )

    def FieldExist(self, Field=defaultNamedNotOptArg):
        'method FieldExist'
        return self._oleobj_.InvokeTypes(10007, LCID, 1, (11, 0), ((8, 1),), Field
                                         )

    def FileTranslate(self, curLang=defaultNamedNotOptArg, transLang=defaultNamedNotOptArg):
        'method FileTranslate'
        return self._oleobj_.InvokeTypes(30121, LCID, 1, (11, 0), ((8, 1), (8, 1)), curLang
                                         , transLang)

    def FillAreaType(self, FillArea=defaultNamedNotOptArg):
        'method FillAreaType'
        return self._oleobj_.InvokeTypes(30018, LCID, 1, (3, 0), ((8, 1),), FillArea
                                         )

    def FindCtrl(self):
        'method FindCtrl'
        # Result is a Unicode object
        return self._oleobj_.InvokeTypes(30003, LCID, 1, (8, 0), (), )

    def FindDir(self, FindDir=defaultNamedNotOptArg):
        'method FindDir'
        return self._oleobj_.InvokeTypes(30068, LCID, 1, (3, 0), ((8, 1),), FindDir
                                         )

    def FindPrivateInfo(self, PrivateType=defaultNamedNotOptArg, PrivateString=defaultNamedOptArg):
        'method FindPrivateInfo'
        return self._oleobj_.InvokeTypes(30109, LCID, 1, (3, 0), ((3, 1), (12, 16)), PrivateType
                                         , PrivateString)

    def FontType(self, FontType=defaultNamedNotOptArg):
        'method FontType'
        return self._oleobj_.InvokeTypes(30019, LCID, 1, (3, 0), ((8, 1),), FontType
                                         )

    def GetBinDataPath(self, binid=defaultNamedNotOptArg):
        'method GetBinDataPath'
        # Result is a Unicode object
        return self._oleobj_.InvokeTypes(30100, LCID, 1, (8, 0), ((3, 1),), binid
                                         )

    def GetCurFieldName(self, option=defaultNamedNotOptArg):
        'method GetCurFieldName'
        # Result is a Unicode object
        return self._oleobj_.InvokeTypes(10011, LCID, 1, (8, 0), ((12, 1),), option
                                         )

    def GetCurMetatagName(self):
        'method GetCurMetatagName'
        # Result is a Unicode object
        return self._oleobj_.InvokeTypes(30124, LCID, 1, (8, 0), (), )

    def GetFieldList(self, Number=defaultNamedNotOptArg, option=defaultNamedNotOptArg):
        'method GetFieldList'
        # Result is a Unicode object
        return self._oleobj_.InvokeTypes(10015, LCID, 1, (8, 0), ((12, 1), (12, 1)), Number
                                         , option)

    def GetFieldText(self, Field=defaultNamedNotOptArg):
        'method GetFieldText'
        # Result is a Unicode object
        return self._oleobj_.InvokeTypes(10008, LCID, 1, (8, 0), ((8, 1),), Field
                                         )

    def GetFileInfo(self, filename=defaultNamedNotOptArg):
        'method GetFileInfo'
        ret = self._oleobj_.InvokeTypes(30094, LCID, 1, (9, 0), ((8, 1),), filename
                                        )
        if ret is not None:
            ret = Dispatch(ret, 'GetFileInfo', None)
        return ret

    def GetFontList(self, langid=defaultNamedOptArg):
        'method GetFontList'
        # Result is a Unicode object
        return self._oleobj_.InvokeTypes(30115, LCID, 1, (8, 0), ((12, 16),), langid
                                         )

    def GetHeadingString(self):
        'method GetHeadingString'
        # Result is a Unicode object
        return self._oleobj_.InvokeTypes(30103, LCID, 1, (8, 0), (), )

    def GetMessageBoxMode(self):
        'method GetMessageBoxMode'
        return self._oleobj_.InvokeTypes(30098, LCID, 1, (3, 0), (), )

    def GetMetatagList(self, Number=defaultNamedNotOptArg, option=defaultNamedNotOptArg):
        'method GetMetatagList'
        # Result is a Unicode object
        return self._oleobj_.InvokeTypes(30130, LCID, 1, (8, 0), ((12, 1), (12, 1)), Number
                                         , option)

    def GetMetatagNameText(self, tag=defaultNamedNotOptArg):
        'method GetMetatagNameText'
        # Result is a Unicode object
        return self._oleobj_.InvokeTypes(30128, LCID, 1, (8, 0), ((8, 1),), tag
                                         )

    def GetMousePos(self, XRelTo=defaultNamedNotOptArg, YRelTo=defaultNamedNotOptArg):
        'method GetMousePos'
        ret = self._oleobj_.InvokeTypes(10034, LCID, 1, (9, 0), ((3, 1), (3, 1)), XRelTo
                                        , YRelTo)
        if ret is not None:
            ret = Dispatch(ret, 'GetMousePos', None)
        return ret

    def GetPageText(self, pgno=defaultNamedNotOptArg, option=defaultNamedNotOptArg):
        'method GetPageText'
        # Result is a Unicode object
        return self._oleobj_.InvokeTypes(30096, LCID, 1, (8, 0), ((3, 1), (12, 1)), pgno
                                         , option)

    def GetPos(self, List=pythoncom.Missing, Para=pythoncom.Missing, pos=pythoncom.Missing):
        'method GetPos'
        return self._ApplyTypes_(10020, 1, (24, 0), ((16387, 2), (16387, 2), (16387, 2)), 'GetPos', None, List
                                 , Para, pos)

    def GetPosBySet(self):
        'method GetPosBySet'
        ret = self._oleobj_.InvokeTypes(10040, LCID, 1, (9, 0), (), )
        if ret is not None:
            ret = Dispatch(ret, 'GetPosBySet', None)
        return ret

    def GetScriptSource(self, filename=defaultNamedNotOptArg):
        'method GetScriptSource'
        # Result is a Unicode object
        return self._oleobj_.InvokeTypes(30093, LCID, 1, (8, 0), ((8, 1),), filename
                                         )

    def GetSelectedPos(self, slist=pythoncom.Missing, spara=pythoncom.Missing, spos=pythoncom.Missing,
                       elist=pythoncom.Missing
                       , epara=pythoncom.Missing, epos=pythoncom.Missing):
        'method GetSelectedPos'
        return self._ApplyTypes_(30105, 1, (11, 0),
                                 ((16387, 2), (16387, 2), (16387, 2), (16387, 2), (16387, 2), (16387, 2)),
                                 'GetSelectedPos', None, slist
                                 , spara, spos, elist, epara, epos
                                 )

    def GetSelectedPosBySet(self, sset=defaultNamedNotOptArg, eset=defaultNamedNotOptArg):
        'method GetSelectedPosBySet'
        return self._oleobj_.InvokeTypes(30106, LCID, 1, (11, 0), ((9, 1), (9, 1)), sset
                                         , eset)

    def GetText(self, Text=pythoncom.Missing):
        'method GetText'
        return self._ApplyTypes_(10019, 1, (3, 0), ((16392, 2),), 'GetText', None, Text
                                 )

    def GetTextFile(self, Format=defaultNamedNotOptArg, option=defaultNamedNotOptArg):
        'method GetTextFile'
        return self._ApplyTypes_(10023, 1, (12, 0), ((8, 1), (8, 1)), 'GetTextFile', None, Format
                                 , option)

    def GetTranslateLangList(self, curLang=defaultNamedNotOptArg):
        'method GetTranslateLangList'
        # Result is a Unicode object
        return self._oleobj_.InvokeTypes(30122, LCID, 1, (8, 0), ((8, 1),), curLang
                                         )

    def GetUserInfo(self, userInfoId=defaultNamedNotOptArg):
        'method GetUserInfo'
        # Result is a Unicode object
        return self._oleobj_.InvokeTypes(30120, LCID, 1, (8, 0), ((3, 1),), userInfoId
                                         )

    def Gradation(self, Gradation=defaultNamedNotOptArg):
        'method Gradation'
        return self._oleobj_.InvokeTypes(30016, LCID, 1, (3, 0), ((8, 1),), Gradation
                                         )

    def GridMethod(self, GridMethod=defaultNamedNotOptArg):
        'method GridMethod'
        return self._oleobj_.InvokeTypes(30059, LCID, 1, (3, 0), ((8, 1),), GridMethod
                                         )

    def GridViewLine(self, GridViewLine=defaultNamedNotOptArg):
        'method GridViewLine'
        return self._oleobj_.InvokeTypes(30060, LCID, 1, (3, 0), ((8, 1),), GridViewLine
                                         )

    def GutterMethod(self, GutterType=defaultNamedNotOptArg):
        'method GutterMethod'
        return self._oleobj_.InvokeTypes(30028, LCID, 1, (3, 0), ((8, 1),), GutterType
                                         )

    def HAlign(self, HAlign=defaultNamedNotOptArg):
        'method HAlign'
        return self._oleobj_.InvokeTypes(30036, LCID, 1, (3, 0), ((8, 1),), HAlign
                                         )

    def Handler(self, Handler=defaultNamedNotOptArg):
        'method Handler'
        return self._oleobj_.InvokeTypes(30033, LCID, 1, (3, 0), ((8, 1),), Handler
                                         )

    def Hash(self, Hash=defaultNamedNotOptArg):
        'method Hash'
        return self._oleobj_.InvokeTypes(30075, LCID, 1, (3, 0), ((8, 1),), Hash
                                         )

    def HatchStyle(self, HatchStyle=defaultNamedNotOptArg):
        'method HatchStyle'
        return self._oleobj_.InvokeTypes(30017, LCID, 1, (3, 0), ((8, 1),), HatchStyle
                                         )

    def HeadType(self, HeadingType=defaultNamedNotOptArg):
        'method HeadType'
        return self._oleobj_.InvokeTypes(30056, LCID, 1, (3, 0), ((8, 1),), HeadingType
                                         )

    def HeightRel(self, HeightRel=defaultNamedNotOptArg):
        'method HeightRel'
        return self._oleobj_.InvokeTypes(30042, LCID, 1, (3, 0), ((8, 1),), HeightRel
                                         )

    def Hiding(self, Hiding=defaultNamedNotOptArg):
        'method Hiding'
        return self._oleobj_.InvokeTypes(30080, LCID, 1, (3, 0), ((8, 1),), Hiding
                                         )

    def HorzRel(self, HorzRel=defaultNamedNotOptArg):
        'method HorzRel'
        return self._oleobj_.InvokeTypes(30040, LCID, 1, (3, 0), ((8, 1),), HorzRel
                                         )

    def HwpLineType(self, LineType=defaultNamedNotOptArg):
        'method HwpLineType'
        return self._oleobj_.InvokeTypes(30009, LCID, 1, (3, 0), ((8, 1),), LineType
                                         )

    def HwpLineWidth(self, LineWidth=defaultNamedNotOptArg):
        'method HwpLineWidth'
        return self._oleobj_.InvokeTypes(30008, LCID, 1, (3, 0), ((8, 1),), LineWidth
                                         )

    def HwpOutlineStyle(self, HwpOutlineStyle=defaultNamedNotOptArg):
        'method HwpOutlineStyle'
        return self._oleobj_.InvokeTypes(30013, LCID, 1, (3, 0), ((8, 1),), HwpOutlineStyle
                                         )

    def HwpOutlineType(self, HwpOutlineType=defaultNamedNotOptArg):
        'method HwpOutlineType'
        return self._oleobj_.InvokeTypes(30021, LCID, 1, (3, 0), ((8, 1),), HwpOutlineType
                                         )

    def HwpUnderlineShape(self, HwpUnderlineShape=defaultNamedNotOptArg):
        'method HwpUnderlineShape'
        return self._oleobj_.InvokeTypes(30090, LCID, 1, (3, 0), ((8, 1),), HwpUnderlineShape
                                         )

    def HwpUnderlineType(self, HwpUnderlineType=defaultNamedNotOptArg):
        'method HwpUnderlineType'
        return self._oleobj_.InvokeTypes(30020, LCID, 1, (3, 0), ((8, 1),), HwpUnderlineType
                                         )

    def HwpZoomType(self, ZoomType=defaultNamedNotOptArg):
        'method HwpZoomType'
        return self._oleobj_.InvokeTypes(30049, LCID, 1, (3, 0), ((8, 1),), ZoomType
                                         )

    def ImageFormat(self, ImageFormat=defaultNamedNotOptArg):
        'method ImageFormat'
        return self._oleobj_.InvokeTypes(30064, LCID, 1, (3, 0), ((8, 1),), ImageFormat
                                         )

    def ImportStyle(self, param=defaultNamedNotOptArg):
        'method ImportStyle'
        return self._oleobj_.InvokeTypes(30002, LCID, 1, (11, 0), ((9, 1),), param
                                         )

    def InitHParameterSet(self):
        'method InitHParameterSet'
        return self._oleobj_.InvokeTypes(10038, LCID, 1, (24, 0), (), )

    def InitScan(self, option=defaultNamedNotOptArg, Range=defaultNamedNotOptArg, spara=defaultNamedNotOptArg,
                 spos=defaultNamedNotOptArg
                 , epara=defaultNamedNotOptArg, epos=defaultNamedNotOptArg):
        'method InitScan'
        return self._oleobj_.InvokeTypes(10017, LCID, 1, (11, 0),
                                         ((12, 1), (12, 1), (12, 1), (12, 1), (12, 1), (12, 1)), option
                                         , Range, spara, spos, epara, epos
                                         )

    def Insert(self, Path=defaultNamedNotOptArg, Format=defaultNamedNotOptArg, arg=defaultNamedNotOptArg):
        'method Insert'
        return self._oleobj_.InvokeTypes(10003, LCID, 1, (24, 0), ((8, 1), (12, 1), (12, 1)), Path
                                         , Format, arg)

    def InsertBackgroundPicture(self, BorderType=defaultNamedNotOptArg, Path=defaultNamedNotOptArg,
                                Embedded=defaultNamedNotOptArg, filloption=defaultNamedNotOptArg
                                , watermark=defaultNamedNotOptArg, Effect=defaultNamedNotOptArg,
                                Brightness=defaultNamedNotOptArg, Contrast=defaultNamedNotOptArg):
        'method InsertBackgroundPicture'
        return self._oleobj_.InvokeTypes(10030, LCID, 1, (11, 0),
                                         ((8, 1), (8, 1), (12, 1), (12, 1), (12, 1), (12, 1), (12, 1), (12, 1)),
                                         BorderType
                                         , Path, Embedded, filloption, watermark, Effect
                                         , Brightness, Contrast)

    def InsertCtrl(self, CtrlID=defaultNamedNotOptArg, initparam=defaultNamedOptArg):
        'method InsertCtrl'
        ret = self._oleobj_.InvokeTypes(10032, LCID, 1, (9, 0), ((8, 1), (12, 16)), CtrlID
                                        , initparam)
        if ret is not None:
            ret = Dispatch(ret, 'InsertCtrl', None)
        return ret

    def InsertPicture(self, Path=defaultNamedNotOptArg, Embedded=defaultNamedNotOptArg,
                      sizeoption=defaultNamedNotOptArg, Reverse=defaultNamedNotOptArg
                      , watermark=defaultNamedNotOptArg, Effect=defaultNamedNotOptArg, Width=defaultNamedNotOptArg,
                      Height=defaultNamedNotOptArg):
        'method InsertPicture'
        ret = self._oleobj_.InvokeTypes(10029, LCID, 1, (9, 0),
                                        ((8, 1), (12, 1), (12, 1), (12, 1), (12, 1), (12, 1), (12, 1), (12, 1)), Path
                                        , Embedded, sizeoption, Reverse, watermark, Effect
                                        , Width, Height)
        if ret is not None:
            ret = Dispatch(ret, 'InsertPicture', None)
        return ret

    def IsActionEnable(self, actionID=defaultNamedNotOptArg):
        'method IsActionEnable'
        return self._oleobj_.InvokeTypes(30092, LCID, 1, (11, 0), ((8, 1),), actionID
                                         )

    def IsCommandLock(self, actionID=defaultNamedNotOptArg):
        'method IsCommandLock'
        return self._oleobj_.InvokeTypes(10028, LCID, 1, (11, 0), ((8, 1),), actionID
                                         )

    def KeyIndicator(self, seccnt=pythoncom.Missing, secno=pythoncom.Missing, prnpageno=pythoncom.Missing,
                     colno=pythoncom.Missing
                     , Line=pythoncom.Missing, pos=pythoncom.Missing, over=pythoncom.Missing,
                     ctrlname=pythoncom.Missing):
        'method KeyIndicator'
        return self._ApplyTypes_(10022, 1, (11, 0), (
        (16387, 2), (16387, 2), (16387, 2), (16387, 2), (16387, 2), (16387, 2), (16386, 2), (16392, 2)), 'KeyIndicator',
                                 None, seccnt
                                 , secno, prnpageno, colno, Line, pos
                                 , over, ctrlname)

    def LineSpacingMethod(self, LineSpacing=defaultNamedNotOptArg):
        'method LineSpacingMethod'
        return self._oleobj_.InvokeTypes(30053, LCID, 1, (3, 0), ((8, 1),), LineSpacing
                                         )

    def LineWrapType(self, LineWrap=defaultNamedNotOptArg):
        'method LineWrapType'
        return self._oleobj_.InvokeTypes(30037, LCID, 1, (3, 0), ((8, 1),), LineWrap
                                         )

    def LockCommand(self, ActID=defaultNamedNotOptArg, isLock=defaultNamedNotOptArg):
        'method LockCommand'
        return self._oleobj_.InvokeTypes(10027, LCID, 1, (24, 0), ((8, 1), (11, 1)), ActID
                                         , isLock)

    def LunarToSolar(self, lYear=defaultNamedNotOptArg, lMonth=defaultNamedNotOptArg, lDay=defaultNamedNotOptArg,
                     lLeap=defaultNamedNotOptArg
                     , sYear=pythoncom.Missing, sMonth=pythoncom.Missing, sDay=pythoncom.Missing):
        'method LunarToSolar'
        return self._ApplyTypes_(30113, 1, (11, 0),
                                 ((3, 1), (3, 1), (3, 1), (11, 1), (16387, 2), (16387, 2), (16387, 2)), 'LunarToSolar',
                                 None, lYear
                                 , lMonth, lDay, lLeap, sYear, sMonth
                                 , sDay)

    def LunarToSolarBySet(self, lYear=defaultNamedNotOptArg, lMonth=defaultNamedNotOptArg, lDay=defaultNamedNotOptArg,
                          lLeap=defaultNamedNotOptArg):
        'method LunarToSolarBySet'
        ret = self._oleobj_.InvokeTypes(30114, LCID, 1, (9, 0), ((3, 1), (3, 1), (3, 1), (11, 1)), lYear
                                        , lMonth, lDay, lLeap)
        if ret is not None:
            ret = Dispatch(ret, 'LunarToSolarBySet', None)
        return ret

    def MacroState(self, MacroState=defaultNamedNotOptArg):
        'method MacroState'
        return self._oleobj_.InvokeTypes(30081, LCID, 1, (3, 0), ((8, 1),), MacroState
                                         )

    def MailType(self, MailType=defaultNamedNotOptArg):
        'method MailType'
        return self._oleobj_.InvokeTypes(30065, LCID, 1, (3, 0), ((8, 1),), MailType
                                         )

    def MetatagExist(self, tag=defaultNamedNotOptArg):
        'method MetatagExist'
        return self._oleobj_.InvokeTypes(30126, LCID, 1, (11, 0), ((8, 1),), tag
                                         )

    def MiliToHwpUnit(self, mili=defaultNamedNotOptArg):
        'method MiliToHwpUnit'
        return self._oleobj_.InvokeTypes(30005, LCID, 1, (3, 0), ((5, 1),), mili
                                         )

    def ModifyFieldProperties(self, Field=defaultNamedNotOptArg, remove=defaultNamedNotOptArg,
                              Add=defaultNamedNotOptArg):
        'method ModifyFieldProperties'
        return self._oleobj_.InvokeTypes(10013, LCID, 1, (3, 0), ((8, 1), (3, 1), (3, 1)), Field
                                         , remove, Add)

    def ModifyMetatagProperties(self, tag=defaultNamedNotOptArg, remove=defaultNamedNotOptArg,
                                Add=defaultNamedNotOptArg):
        'method ModifyMetatagProperties'
        return self._oleobj_.InvokeTypes(30131, LCID, 1, (3, 0), ((8, 1), (3, 1), (3, 1)), tag
                                         , remove, Add)

    def MovePos(self, moveID=defaultNamedNotOptArg, Para=defaultNamedNotOptArg, pos=defaultNamedNotOptArg):
        'method MovePos'
        return self._oleobj_.InvokeTypes(10016, LCID, 1, (11, 0), ((12, 1), (12, 1), (12, 1)), moveID
                                         , Para, pos)

    def MoveToField(self, Field=defaultNamedNotOptArg, Text=defaultNamedNotOptArg, start=defaultNamedNotOptArg,
                    select=defaultNamedNotOptArg):
        'method MoveToField'
        return self._oleobj_.InvokeTypes(10006, LCID, 1, (11, 0), ((8, 1), (12, 1), (12, 1), (12, 1)), Field
                                         , Text, start, select)

    def MoveToMetatag(self, tag=defaultNamedNotOptArg, Text=defaultNamedNotOptArg, start=defaultNamedNotOptArg,
                      select=defaultNamedNotOptArg):
        'method MoveToMetatag'
        return self._oleobj_.InvokeTypes(30127, LCID, 1, (11, 0), ((8, 1), (12, 1), (12, 1), (12, 1)), tag
                                         , Text, start, select)

    def NumberFormat(self, NumFormat=defaultNamedNotOptArg):
        'method NumberFormat'
        return self._oleobj_.InvokeTypes(30026, LCID, 1, (3, 0), ((8, 1),), NumFormat
                                         )

    def Numbering(self, Numbering=defaultNamedNotOptArg):
        'method Numbering'
        return self._oleobj_.InvokeTypes(30077, LCID, 1, (3, 0), ((8, 1),), Numbering
                                         )

    def Open(self, filename=defaultNamedNotOptArg, Format=defaultNamedNotOptArg, arg=defaultNamedNotOptArg):
        'method Open'
        return self._oleobj_.InvokeTypes(10000, LCID, 1, (11, 0), ((8, 1), (12, 1), (12, 1)), filename
                                         , Format, arg)

    def PageNumPosition(self, pagenumpos=defaultNamedNotOptArg):
        'method PageNumPosition'
        return self._oleobj_.InvokeTypes(30058, LCID, 1, (3, 0), ((8, 1),), pagenumpos
                                         )

    def PageType(self, PageType=defaultNamedNotOptArg):
        'method PageType'
        return self._oleobj_.InvokeTypes(30030, LCID, 1, (3, 0), ((8, 1),), PageType
                                         )

    def ParaHeadAlign(self, ParaHeadAlign=defaultNamedNotOptArg):
        'method ParaHeadAlign'
        return self._oleobj_.InvokeTypes(30025, LCID, 1, (3, 0), ((8, 1),), ParaHeadAlign
                                         )

    def PicEffect(self, PicEffect=defaultNamedNotOptArg):
        'method PicEffect'
        return self._oleobj_.InvokeTypes(30010, LCID, 1, (3, 0), ((8, 1),), PicEffect
                                         )

    def PlacementType(self, Restart=defaultNamedNotOptArg):
        'method PlacementType'
        return self._oleobj_.InvokeTypes(30027, LCID, 1, (3, 0), ((8, 1),), Restart
                                         )

    def PointToHwpUnit(self, Point=defaultNamedNotOptArg):
        'method PointToHwpUnit'
        return self._oleobj_.InvokeTypes(30006, LCID, 1, (3, 0), ((5, 1),), Point
                                         )

    def PresentEffect(self, prsnteffect=defaultNamedNotOptArg):
        'method PresentEffect'
        return self._oleobj_.InvokeTypes(30089, LCID, 1, (3, 0), ((8, 1),), prsnteffect
                                         )

    def PrintDevice(self, PrintDevice=defaultNamedNotOptArg):
        'method PrintDevice'
        return self._oleobj_.InvokeTypes(30052, LCID, 1, (3, 0), ((8, 1),), PrintDevice
                                         )

    def PrintPaper(self, PrintPaper=defaultNamedNotOptArg):
        'method PrintPaper'
        return self._oleobj_.InvokeTypes(30078, LCID, 1, (3, 0), ((8, 1),), PrintPaper
                                         )

    def PrintRange(self, PrintRange=defaultNamedNotOptArg):
        'method PrintRange'
        return self._oleobj_.InvokeTypes(30050, LCID, 1, (3, 0), ((8, 1),), PrintRange
                                         )

    def PrintType(self, PrintMethod=defaultNamedNotOptArg):
        'method PrintType'
        return self._oleobj_.InvokeTypes(30051, LCID, 1, (3, 0), ((8, 1),), PrintMethod
                                         )

    def ProtectPrivateInfo(self, PotectingChar=defaultNamedNotOptArg, PrivatePatternType=defaultNamedOptArg):
        'method ProtectPrivateInfo'
        return self._oleobj_.InvokeTypes(30110, LCID, 1, (11, 0), ((8, 1), (12, 16)), PotectingChar
                                         , PrivatePatternType)

    def PutFieldText(self, Field=defaultNamedNotOptArg, Text=defaultNamedNotOptArg):
        'method PutFieldText'
        return self._oleobj_.InvokeTypes(10009, LCID, 1, (24, 0), ((8, 1), (8, 1)), Field
                                         , Text)

    def PutMetatagNameText(self, tag=defaultNamedNotOptArg, Text=defaultNamedNotOptArg):
        'method PutMetatagNameText'
        return self._oleobj_.InvokeTypes(30129, LCID, 1, (24, 0), ((8, 1), (8, 1)), tag
                                         , Text)

    def Quit(self):
        'method Quit'
        return self._oleobj_.InvokeTypes(30000, LCID, 1, (24, 0), (), )

    def RGBColor(self, red=defaultNamedNotOptArg, green=defaultNamedNotOptArg, blue=defaultNamedNotOptArg):
        'method RGBColor'
        return self._oleobj_.InvokeTypes(30007, LCID, 1, (3, 0), ((17, 1), (17, 1), (17, 1)), red
                                         , green, blue)

    def RegisterModule(self, ModuleType=defaultNamedNotOptArg, ModuleData=defaultNamedNotOptArg):
        'method RegisterModule'
        return self._oleobj_.InvokeTypes(10036, LCID, 1, (11, 0), ((8, 1), (12, 1)), ModuleType
                                         , ModuleData)

    def RegisterPrivateInfoPattern(self, PrivateType=defaultNamedNotOptArg, PrivatePattern=defaultNamedNotOptArg):
        'method RegisterPrivateInfoPattern'
        return self._oleobj_.InvokeTypes(30108, LCID, 1, (11, 0), ((3, 1), (8, 1)), PrivateType
                                         , PrivatePattern)

    def ReleaseAction(self, action=defaultNamedNotOptArg):
        'method ReleaseAction'
        return self._oleobj_.InvokeTypes(30118, LCID, 1, (24, 0), ((9, 1),), action
                                         )

    def ReleaseScan(self):
        'method ReleaseScan'
        return self._oleobj_.InvokeTypes(10018, LCID, 1, (24, 0), (), )

    def RenameField(self, oldname=defaultNamedNotOptArg, newname=defaultNamedNotOptArg):
        'method RenameField'
        return self._oleobj_.InvokeTypes(10010, LCID, 1, (24, 0), ((8, 1), (8, 1)), oldname
                                         , newname)

    def RenameMetatag(self, oldtag=defaultNamedNotOptArg, newtag=defaultNamedNotOptArg):
        'method RenameMetatag'
        return self._oleobj_.InvokeTypes(30125, LCID, 1, (24, 0), ((8, 1), (8, 1)), oldtag
                                         , newtag)

    def ReplaceAction(self, OldActionID=defaultNamedNotOptArg, NewActionID=defaultNamedNotOptArg):
        'method ReplaceAction'
        return self._oleobj_.InvokeTypes(10037, LCID, 1, (11, 0), ((8, 1), (8, 1)), OldActionID
                                         , NewActionID)

    def ReplaceFont(self, langid=defaultNamedNotOptArg, desFontName=defaultNamedNotOptArg,
                    desFontType=defaultNamedNotOptArg, newFontName=defaultNamedNotOptArg
                    , newFontType=defaultNamedNotOptArg):
        'method ReplaceFont'
        return self._oleobj_.InvokeTypes(30116, LCID, 1, (11, 0), ((3, 1), (8, 1), (3, 1), (8, 1), (3, 1)), langid
                                         , desFontName, desFontType, newFontName, newFontType)

    def Revision(self, Revision=defaultNamedNotOptArg):
        'method Revision'
        return self._oleobj_.InvokeTypes(30071, LCID, 1, (3, 0), ((8, 1),), Revision
                                         )

    def Run(self, ActID=defaultNamedNotOptArg):
        'method Run'
        return self._oleobj_.InvokeTypes(10026, LCID, 1, (24, 0), ((8, 1),), ActID
                                         )

    def RunScriptMacro(self, FunctionName=defaultNamedNotOptArg, uMacroType=defaultNamedNotOptArg,
                       uScriptType=defaultNamedNotOptArg):
        'method RunScriptMacro'
        return self._oleobj_.InvokeTypes(30095, LCID, 1, (11, 0), ((8, 1), (3, 1), (3, 1)), FunctionName
                                         , uMacroType, uScriptType)

    def Save(self, save_if_dirty=defaultNamedNotOptArg):
        'method Save'
        return self._oleobj_.InvokeTypes(10001, LCID, 1, (11, 0), ((12, 1),), save_if_dirty
                                         )

    def SaveAs(self, Path=defaultNamedNotOptArg, Format=defaultNamedNotOptArg, arg=defaultNamedNotOptArg):
        'method SaveAs'
        return self._oleobj_.InvokeTypes(10002, LCID, 1, (11, 0), ((8, 1), (12, 1), (12, 1)), Path
                                         , Format, arg)

    def ScanFont(self):
        'method ScanFont'
        return self._oleobj_.InvokeTypes(30117, LCID, 1, (11, 0), (), )

    def SelectText(self, spara=defaultNamedNotOptArg, spos=defaultNamedNotOptArg, epara=defaultNamedNotOptArg,
                   epos=defaultNamedNotOptArg):
        'method SelectText'
        return self._oleobj_.InvokeTypes(10004, LCID, 1, (11, 0), ((3, 1), (3, 1), (3, 1), (3, 1)), spara
                                         , spos, epara, epos)

    def SetBarCodeImage(self, lpImagePath=defaultNamedNotOptArg, pgno=defaultNamedNotOptArg,
                        index=defaultNamedNotOptArg, X=defaultNamedNotOptArg
                        , Y=defaultNamedNotOptArg, Width=defaultNamedNotOptArg, Height=defaultNamedNotOptArg):
        'method SetBarCodeImage'
        return self._oleobj_.InvokeTypes(30097, LCID, 1, (11, 0),
                                         ((8, 1), (3, 1), (3, 1), (3, 1), (3, 1), (3, 1), (3, 1)), lpImagePath
                                         , pgno, index, X, Y, Width
                                         , Height)

    def SetCurFieldName(self, Field=defaultNamedNotOptArg, option=defaultNamedNotOptArg,
                        Direction=defaultNamedNotOptArg, memo=defaultNamedNotOptArg):
        'method SetCurFieldName'
        return self._oleobj_.InvokeTypes(10012, LCID, 1, (11, 0), ((8, 1), (12, 1), (8, 1), (8, 1)), Field
                                         , option, Direction, memo)

    def SetCurMetatagName(self, tag=defaultNamedNotOptArg):
        'method SetCurMetatagName'
        return self._oleobj_.InvokeTypes(30123, LCID, 1, (11, 0), ((8, 1),), tag
                                         )

    def SetDRMAuthority(self, authority=defaultNamedNotOptArg):
        'method SetDRMAuthority'
        return self._oleobj_.InvokeTypes(30101, LCID, 1, (11, 0), ((3, 1),), authority
                                         )

    def SetFieldViewOption(self, option=defaultNamedNotOptArg):
        'method SetFieldViewOption'
        return self._oleobj_.InvokeTypes(10014, LCID, 1, (3, 0), ((3, 1),), option
                                         )

    def SetMessageBoxMode(self, Mode=defaultNamedNotOptArg):
        'method SetMessageBoxMode'
        return self._oleobj_.InvokeTypes(30099, LCID, 1, (3, 0), ((3, 1),), Mode
                                         )

    def SetPos(self, List=defaultNamedNotOptArg, Para=defaultNamedNotOptArg, pos=defaultNamedNotOptArg):
        'method SetPos'
        return self._oleobj_.InvokeTypes(10021, LCID, 1, (11, 0), ((3, 1), (3, 1), (3, 1)), List
                                         , Para, pos)

    def SetPosBySet(self, dispVal=defaultNamedNotOptArg):
        'method SetPosBySet'
        return self._oleobj_.InvokeTypes(10041, LCID, 1, (11, 0), ((9, 1),), dispVal
                                         )

    def SetPrivateInfoPassword(self, Password=defaultNamedNotOptArg):
        'method SetPrivateInfoPassword'
        return self._oleobj_.InvokeTypes(30107, LCID, 1, (11, 0), ((8, 1),), Password
                                         )

    def SetTextFile(self, data=defaultNamedNotOptArg, Format=defaultNamedNotOptArg, option=defaultNamedNotOptArg):
        'method SetTextFile'
        return self._oleobj_.InvokeTypes(10024, LCID, 1, (3, 0), ((12, 1), (8, 1), (8, 1)), data
                                         , Format, option)

    def SetTitleName(self, Title=defaultNamedNotOptArg):
        'method SetTitleName'
        return self._oleobj_.InvokeTypes(30104, LCID, 1, (24, 0), ((8, 1),), Title
                                         )

    def SetUserInfo(self, userInfoId=defaultNamedNotOptArg, Value=defaultNamedNotOptArg):
        'method SetUserInfo'
        return self._oleobj_.InvokeTypes(30119, LCID, 1, (24, 0), ((3, 1), (8, 1)), userInfoId
                                         , Value)

    def SideType(self, SideType=defaultNamedNotOptArg):
        'method SideType'
        return self._oleobj_.InvokeTypes(30046, LCID, 1, (3, 0), ((8, 1),), SideType
                                         )

    def Signature(self, Signature=defaultNamedNotOptArg):
        'method Signature'
        return self._oleobj_.InvokeTypes(30073, LCID, 1, (3, 0), ((8, 1),), Signature
                                         )

    def Slash(self, Slash=defaultNamedNotOptArg):
        'method Slash'
        return self._oleobj_.InvokeTypes(30085, LCID, 1, (3, 0), ((8, 1),), Slash
                                         )

    def SolarToLunar(self, sYear=defaultNamedNotOptArg, sMonth=defaultNamedNotOptArg, sDay=defaultNamedNotOptArg,
                     lYear=pythoncom.Missing
                     , lMonth=pythoncom.Missing, lDay=pythoncom.Missing, lLeap=pythoncom.Missing):
        'method SolarToLunar'
        return self._ApplyTypes_(30111, 1, (11, 0),
                                 ((3, 1), (3, 1), (3, 1), (16387, 2), (16387, 2), (16387, 2), (16395, 2)),
                                 'SolarToLunar', None, sYear
                                 , sMonth, sDay, lYear, lMonth, lDay
                                 , lLeap)

    def SolarToLunarBySet(self, sYear=defaultNamedNotOptArg, sMonth=defaultNamedNotOptArg, sDay=defaultNamedNotOptArg):
        'method SolarToLunarBySet'
        ret = self._oleobj_.InvokeTypes(30112, LCID, 1, (9, 0), ((3, 1), (3, 1), (3, 1)), sYear
                                        , sMonth, sDay)
        if ret is not None:
            ret = Dispatch(ret, 'SolarToLunarBySet', None)
        return ret

    def SortDelimiter(self, SortDelimiter=defaultNamedNotOptArg):
        'method SortDelimiter'
        return self._oleobj_.InvokeTypes(30070, LCID, 1, (3, 0), ((8, 1),), SortDelimiter
                                         )

    def StrikeOut(self, StrikeOutType=defaultNamedNotOptArg):
        'method StrikeOut'
        return self._oleobj_.InvokeTypes(30023, LCID, 1, (3, 0), ((8, 1),), StrikeOutType
                                         )

    def StyleType(self, StyleType=defaultNamedNotOptArg):
        'method StyleType'
        return self._oleobj_.InvokeTypes(30088, LCID, 1, (3, 0), ((8, 1),), StyleType
                                         )

    def SubtPos(self, SubtPos=defaultNamedNotOptArg):
        'method SubtPos'
        return self._oleobj_.InvokeTypes(30063, LCID, 1, (3, 0), ((8, 1),), SubtPos
                                         )

    def TableBreak(self, PageBreak=defaultNamedNotOptArg):
        'method TableBreak'
        return self._oleobj_.InvokeTypes(30048, LCID, 1, (3, 0), ((8, 1),), PageBreak
                                         )

    def TableFormat(self, TableFormat=defaultNamedNotOptArg):
        'method TableFormat'
        return self._oleobj_.InvokeTypes(30082, LCID, 1, (3, 0), ((8, 1),), TableFormat
                                         )

    def TableSwapType(self, tableswap=defaultNamedNotOptArg):
        'method TableSwapType'
        return self._oleobj_.InvokeTypes(30069, LCID, 1, (3, 0), ((8, 1),), tableswap
                                         )

    def TableTarget(self, TableTarget=defaultNamedNotOptArg):
        'method TableTarget'
        return self._oleobj_.InvokeTypes(30083, LCID, 1, (3, 0), ((8, 1),), TableTarget
                                         )

    def TextAlign(self, TextAlign=defaultNamedNotOptArg):
        'method TextAlign'
        return self._oleobj_.InvokeTypes(30055, LCID, 1, (3, 0), ((8, 1),), TextAlign
                                         )

    def TextArtAlign(self, TextArtAlign=defaultNamedNotOptArg):
        'method TextArtAlign'
        return self._oleobj_.InvokeTypes(30045, LCID, 1, (3, 0), ((8, 1),), TextArtAlign
                                         )

    def TextDir(self, TextDirection=defaultNamedNotOptArg):
        'method TextDir'
        return self._oleobj_.InvokeTypes(30029, LCID, 1, (3, 0), ((8, 1),), TextDirection
                                         )

    def TextFlowType(self, TextFlow=defaultNamedNotOptArg):
        'method TextFlowType'
        return self._oleobj_.InvokeTypes(30044, LCID, 1, (3, 0), ((8, 1),), TextFlow
                                         )

    def TextWrapType(self, TextWrap=defaultNamedNotOptArg):
        'method TextWrapType'
        return self._oleobj_.InvokeTypes(30043, LCID, 1, (3, 0), ((8, 1),), TextWrap
                                         )

    def UnSelectCtrl(self):
        'method UnSelectCtrl'
        return self._oleobj_.InvokeTypes(30004, LCID, 1, (24, 0), (), )

    def VAlign(self, VAlign=defaultNamedNotOptArg):
        'method VAlign'
        return self._oleobj_.InvokeTypes(30038, LCID, 1, (3, 0), ((8, 1),), VAlign
                                         )

    def VertRel(self, VertRel=defaultNamedNotOptArg):
        'method VertRel'
        return self._oleobj_.InvokeTypes(30039, LCID, 1, (3, 0), ((8, 1),), VertRel
                                         )

    def ViewFlag(self, ViewFlag=defaultNamedNotOptArg):
        'method ViewFlag'
        return self._oleobj_.InvokeTypes(30084, LCID, 1, (3, 0), ((8, 1),), ViewFlag
                                         )

    def WatermarkBrush(self, WatermarkBrush=defaultNamedNotOptArg):
        'method WatermarkBrush'
        return self._oleobj_.InvokeTypes(30087, LCID, 1, (3, 0), ((8, 1),), WatermarkBrush
                                         )

    def WidthRel(self, WidthRel=defaultNamedNotOptArg):
        'method WidthRel'
        return self._oleobj_.InvokeTypes(30041, LCID, 1, (3, 0), ((8, 1),), WidthRel
                                         )

    _prop_map_get_ = {
        "Application": (20000, 2, (9, 0), (), "Application", None),
        "CellShape": (7, 2, (9, 0), (), "CellShape", None),
        "CharShape": (8, 2, (9, 0), (), "CharShape", None),
        "CurFieldState": (5, 2, (3, 0), (), "CurFieldState", None),
        "CurMetatagState": (20103, 2, (3, 0), (), "CurMetatagState", None),
        "CurSelectedCtrl": (11, 2, (9, 0), (), "CurSelectedCtrl", None),
        "EditMode": (3, 2, (3, 0), (), "EditMode", None),
        "EngineProperties": (20102, 2, (9, 0), (), "EngineProperties", None),
        "HAction": (20005, 2, (9, 0), (), "HAction", None),
        "HParameterSet": (20004, 2, (9, 0), (), "HParameterSet", None),
        "HeadCtrl": (9, 2, (9, 0), (), "HeadCtrl", None),
        "IsEmpty": (2, 2, (11, 0), (), "IsEmpty", None),
        "IsModified": (1, 2, (11, 0), (), "IsModified", None),
        "IsPrivateInfoProtected": (16, 2, (11, 0), (), "IsPrivateInfoProtected", None),
        "IsTrackChange": (20104, 2, (3, 0), (), "IsTrackChange", None),
        "IsTrackChangePassword": (20105, 2, (11, 0), (), "IsTrackChangePassword", None),
        "LastCtrl": (10, 2, (9, 0), (), "LastCtrl", None),
        "PageCount": (6, 2, (3, 0), (), "PageCount", None),
        "ParaShape": (12, 2, (9, 0), (), "ParaShape", None),
        "ParentCtrl": (13, 2, (9, 0), (), "ParentCtrl", None),
        "Path": (15, 2, (8, 0), (), "Path", None),
        "SelectionMode": (4, 2, (3, 0), (), "SelectionMode", None),
        "Version": (20101, 2, (8, 0), (), "Version", None),
        "ViewProperties": (14, 2, (9, 0), (), "ViewProperties", None),
        "XHwpDocuments": (20002, 2, (9, 0), (), "XHwpDocuments", None),
        "XHwpMessageBox": (20001, 2, (9, 0), (), "XHwpMessageBox", None),
        "XHwpODBC": (20006, 2, (9, 0), (), "XHwpODBC", None),
        "XHwpWindows": (20003, 2, (9, 0), (), "XHwpWindows", None),
    }
    _prop_map_put_ = {
        "CellShape": ((7, LCID, 4, 0), ()),
        "CharShape": ((8, LCID, 4, 0), ()),
        "EditMode": ((3, LCID, 4, 0), ()),
        "EngineProperties": ((20102, LCID, 4, 0), ()),
        "IsTrackChange": ((20104, LCID, 4, 0), ()),
        "ParaShape": ((12, LCID, 4, 0), ()),
        "ViewProperties": ((14, LCID, 4, 0), ()),
    }

    def __iter__(self):
        "Return a Python iterator for this object"
        try:
            ob = self._oleobj_.InvokeTypes(-4, LCID, 3, (13, 10), ())
        except pythoncom.error:
            raise TypeError("This object does not support enumeration")
        return win32com.client.util.Iterator(ob, None)

 

어느 정도 한/글 API문서나 코딩에 익숙해지고, 자신이 붙었다면

이 파일을 참고해보시는 것도 크게 도움이 될 것입니다.

 

3-2. 대부분의 액션이름과 파라미터셋 조회가능

한/글 API의 메서드는 특이하게도 동일한 액션을 다양한 문법으로 실행할 수 있는데요.

역사가 오래다 보니, 최적화를 계속하면서 하위호환성을 유지하기 위해(?) 기존의 문법을 남겨두었나 추측해봅니다.

한/글의 메서드 문법 종류는 대략 아래 네 가지 정도입니다.

3-2-1. hwp.HAction.Run(액션이름) 을 통한 한 줄 문법(파라미터가 없는 명령어만 실행가능)

>>> hwp.HAction.Run("Delete")  # Del키를 누르는 효과. 한 글자 삭제.
True

>>> hwp.CreateAction("Delete").Run()  # 위와 동일한 의미의 코드
True

...

 

3-2-2. act 및 pset을 각각 정의하는 문법(GetDefault 실행 후 pset의 현재값 조회 가능)

# 현재 선택범위의 글자크기를 10pt로 변경하는 코드

>>> act = hwp.CreateAction("CharShape")  # 글자모양 액션 생성
>>> pset = act.CreateSet()  # 글자모양 액션의 파라미터셋 생성
>>> act.GetDefault(pset)  # 현재 문서의 값으로 파라미터셋 초기화
1

>>> print(pset.Item("Height"))  # 현재 커서위치의 글자크기도 출력 가능
10000  # 10,000 HwpUnit == 100pt

>>> pset.SetItem("Height", hwp.PointToHwpUnit(10))  # 현재 선택범위의 글자크기를 10포인트로 변경
>>> act.Execute(pset)  # 변경된 파라미터셋으로 액션 실행(여기까지 실행하면 글자크기가 10pt로 변경됨)
True  # 정상적으로 실행되었으면 True 리턴

 

3-2-3. pset 정의 없이 바로 GetDefault를 실행하는 문법(최신)

# 현재 선택범위의 글자크기를 10pt로 변경하는 동일한 코드

hwp.HAction.GetDefault("CharShape", hwp.HParameterSet.HCharShape.HSet)
hwp.HParameterSet.HCharShape.Height = hwp.PointToHwpUnit(10.0)
hwp.HAction.Execute("CharShape", hwp.HParameterSet.HCharShape.HSet)

 

3-2-4. hwp.XHwpDocuments 를 이용하는 문법

# 현재 선택범위의 글자크기를 10pt로 변경하는 동일한 코드
>>> hwp.XHwpDocuments.Item(0).XHwpCharacterShape.Height = 1000

# 현재 커서위치의 글자크기 조회도 (GetDefault 없이) 한 줄로 가능
>>> print(hwp.XHwpDocuments.Item(0).XHwpCharacterShape.Height)
1000

 

위 네 가지 문법 중 2, 3, 4번은 타입라이브러리 문서를 통해 액션아이디와 파라미터셋 정보를 얻을 수 있습니다.

단 Run메서드 안에 들어가는 액션아이디, 즉 파라미터셋이 필요없는 액션아이디 목록은

타입라이브러리 파일 안에서도 찾을 수 없었습니다..

 

마치며

이번 포스팅에서는

아래아한글 자동화 코드를 작성할 때 도움이 되는

세 가지 팁인

1. 에디터 말고 콘솔에서 자동완성

2. 변수지정으로 자동완성

3. 타입라이브러리 참고

에 대해 알려드렸습니다.

 

감사합니다.

행복한 하루 되세요!

댓글