# c#으로 아래한글 자동화 할때 한글 버전을 선택할 수 있나요?

**URL:** <https://forum.developer.hancom.com/t/c/666>\
**Category:** 한글 오토메이션\
**Created:** [5월 10, 2023, 1:33오전 UTC](https://forum.developer.hancom.com/t/c/666 "2023-05-10T01:33:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nuristar](https://avatars.discourse-cdn.com/v4/letter/n/bc79bd/32.png) [@nuristar](https://forum.developer.hancom.com/u/nuristar)\
**Post date:** [5월 10, 2023, 1:33오전 UTC](https://forum.developer.hancom.com/t/c/666/1 "2023-05-10T01:33:12Z")

</div>

윈도우에 설치된 아래한글의 폴더 위치를 확인하는 방법이 있나요?  
두개 이상의 다른 버전이 설치 되어 있을 때 각각 실행파일 위치를 확인학고 싶습니다.

자동화 할 때 원하는 버전을 선택해서 실행하고 싶어요

---

<div class="post-metadata">

**Author:** ![bhjung](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.developer.hancom.com/bhjung/32/259_2.png) [@bhjung](https://forum.developer.hancom.com/u/bhjung)\
**Post date:** [5월 10, 2023, 2:05오전 UTC](https://forum.developer.hancom.com/t/c/666/2 "2023-05-10T02:05:59Z")

</div>

안녕하세요 ^^  
음 저라면 다음과 같은 방법을 사용해보겠습니다.

1. 레지스트리 확인, 오토메이션 CLSID를 이용해 LocalSever32에 등록된 데이터 값을 통해 오토메이션 경로 확인  
아래의 레지스트리 경로 값을 확인해보시면 오토메이션 경로가 확인 가능합니다 ^^  
“컴퓨터\HKEY\_CLASSES\_ROOT\WOW6432Node\CLSID{2291CF00-64A1-4877-A9B4-68CFE89612D6}\LocalServer32”

2. 오토메이션 Version api 사용  
version api를 호출하면 해당 한글의 버전값을 스트링으로 주는데 메인 버전값은 다음과 같습니다.  
이러한 버전값을 통해 경로를 미리 설정해둘수 있지 않을가 싶습니다.  
12 : 한글 2022  
11 : 한글 2020  
10 : 한글 2018  
9.6 : 한글 NEO  
9 : 한글 2014

감사합니다 ^^

---

<div class="post-metadata">

**Author:** ![nuristar](https://avatars.discourse-cdn.com/v4/letter/n/bc79bd/32.png) [@nuristar](https://forum.developer.hancom.com/u/nuristar)\
**Post date:** [5월 10, 2023, 3:53오전 UTC](https://forum.developer.hancom.com/t/c/666/3 "2023-05-10T03:53:46Z")

</div>

감사합니다.  
일단 콤보박스로 원하는 버전 선택해서 레지스트리 조작으로 버전관리는 했는데요.(관리자 모드로만 레지스트 수정이 되네요.)  
public static string hwpreg = @“WOW6432Node\CLSID{2291CF00-64A1-4877-A9B4-68CFE89612D6}\LocalServer32”;  
RegistryKey hwp\_regkey = Registry.ClassesRoot.OpenSubKey(hwpreg, true);

// 레지스트리 값 쓰기  
public void writeReg(RegistryKey key, string name, string value)  
{  
key.SetValue(name, value);  
}

string hwp2010 = @“C:\Program Files (x86)\Hnc2010\Hwp80\Hwp.exe -Automation”;  
string hwp2018 = @“C:\Program Files (x86)\HNC\Office 2018\HOffice100\Bin\Hwp.exe -Automation”;

// 선택 버전별 레지스트리 수정  
if (comboBox1.SelectedIndex == 0)  
{  
writeReg(hwp\_regkey, “”, hwp2010);  
MessageBox.Show(“아래한글 자동화 버전을 한글 2010으로 설정합니다.”);  
}  
else if (comboBox1.SelectedIndex == 1)  
{  
writeReg(hwp\_regkey, “”, hwp2018);  
MessageBox.Show(“아래한글 자동화 버전을 한글 2018으로 설정합니다.”);  
}

이런식으로…

근데… 답글 중에 2번. 오토메이션 Version Api 사용을 어떤식으로 하는건지… 예를 보여주실 수 있을까요? (어떻게 하는건지… api 호출 코드 같은걸 몰라서요 ㅠㅠ)

---

<div class="post-metadata">

**Author:** ![bhjung](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.developer.hancom.com/bhjung/32/259_2.png) [@bhjung](https://forum.developer.hancom.com/u/bhjung)\
**Post date:** [5월 10, 2023, 7:27오전 UTC](https://forum.developer.hancom.com/t/c/666/4 "2023-05-10T07:27:56Z")

</div>

2번 같은 경우는 단순히 오토메이션의 api입니다 …!

app.CreateDispatch(“HwpFrame.HwpObject”);  
app.Version ← 이렇게 사용하시면 해당 버전이 스트링으로 나오게됩니다 …!

그리고 레지스트리 값을 확인후 직접 레지스트리 수정보다는  
한글 오토메이션을 정상적으로 등록을 하시려면

아래와같이 한글에 명령어 -regserver를 주어 실행하면 해당 버전의 한글이 오토메이션 등록이 됩니다.  
관리자 권한이 필요합니다 …!  
C:\Program Files (x86)\Hnc\Office 2020\HOffice110\Bin\hwp.exe -regserver

감사합니다.

---

<div class="post-metadata">

**Author:** ![nuristar](https://avatars.discourse-cdn.com/v4/letter/n/bc79bd/32.png) [@nuristar](https://forum.developer.hancom.com/u/nuristar)\
**Post date:** [5월 11, 2023, 1:38오전 UTC](https://forum.developer.hancom.com/t/c/666/5 "2023-05-11T01:38:36Z")

</div>

아… 그렇군요… 방법을 몰라서… 레지스트리 조작을 했네요 ㅎㅎ  
감사합니다.

---

<div class="post-metadata">

**Author:** ![nuristar](https://avatars.discourse-cdn.com/v4/letter/n/bc79bd/32.png) [@nuristar](https://forum.developer.hancom.com/u/nuristar)\
**Post date:** [5월 11, 2023, 3:07오전 UTC](https://forum.developer.hancom.com/t/c/666/6 "2023-05-11T03:07:23Z")

</div>

관리자 권한으로 실행했는데도 자동화 버전이 안바뀌네요.

한글 2020으로 되어서…  
한글 2018로 변경할려고 아래처럼 했는데(관리자 권한으로요)

C:\Program Files (x86)\HNC\Office 2018\HOffice100\Bin\hwp.exe -regserver

계속 한글 2020으로 되네요…  
레지스트리 내용을 봐도 바뀌지가 않구요…

---

<div class="post-metadata">

**Author:** ![bhjung](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.developer.hancom.com/bhjung/32/259_2.png) [@bhjung](https://forum.developer.hancom.com/u/bhjung)\
**Post date:** [5월 11, 2023, 5:02오전 UTC](https://forum.developer.hancom.com/t/c/666/7 "2023-05-11T05:02:01Z")

</div>

안녕하세요,  
엇 … 저는 정상적으로 잘바뀌는데요 왜그럴까요 ㅠ …  
안된다면 레지스트리를 직접 수정하는수밖에 없을것 같습니다 ㅠ…!

1. 기존 한글 2022 오토메이션 등록 상태.  

2. 관리자 권한으로 -regserver 실행  

3. 오토메이션 한글 2020 등록 확인

---

<div class="post-metadata">

**Author:** ![nuristar](https://avatars.discourse-cdn.com/v4/letter/n/bc79bd/32.png) [@nuristar](https://forum.developer.hancom.com/u/nuristar)\
**Post date:** [5월 11, 2023, 5:28오전 UTC](https://forum.developer.hancom.com/t/c/666/8 "2023-05-11T05:28:05Z")

</div>

아… 잘 되네요… 뭐가 문제였는지 모르겠는데  
다시 해보니까 잘 되네요 …  
감사합니다.

---

<div class="post-metadata">

**Author:** ![bhjung](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.developer.hancom.com/bhjung/32/259_2.png) [@bhjung](https://forum.developer.hancom.com/u/bhjung)\
**Post date:** [5월 11, 2023, 8:06오전 UTC](https://forum.developer.hancom.com/t/c/666/9 "2023-05-11T08:06:58Z")

</div>

도움이 돼서 다행이네요 ^^  
좋은 저녁 보내세요~!

---

<div class="post-metadata">

**Author:** ![nuristar](https://avatars.discourse-cdn.com/v4/letter/n/bc79bd/32.png) [@nuristar](https://forum.developer.hancom.com/u/nuristar)\
**Post date:** [9월 20, 2024, 1:57오전 UTC](https://forum.developer.hancom.com/t/c/666/10 "2024-09-20T01:57:36Z")

</div>

한글 버전 확인할때  
한글 2010, 2010se, 2012도 확인 할 수 있을까요?
