# 바탕쪽 삭제 할 때 메시지박스 안나오게

**URL:** <https://forum.developer.hancom.com/t/topic/697>\
**Category:** 한글 오토메이션\
**Created:** [5월 26, 2023, 4:42오전 UTC](https://forum.developer.hancom.com/t/topic/697 "2023-05-26T04:42:39Z")\
**Posts on this page:** 8\
**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월 26, 2023, 4:42오전 UTC](https://forum.developer.hancom.com/t/topic/697/1 "2023-05-26T04:42:39Z")

</div>

안녕하세요.. 바탕쪽을 지울려고 하는데 메시지 박스가 계속 나오는데..

hwp.SetMessageBoxMode(0x10000); // 메시지 박스 자동 확인 버튼  
hwp.SetMessageBoxMode(0x00002000); // 메시지 박스 자동 확인 버튼

이 두가지를 해봤는데 둘다 나오더라구요..

 ![image](https://us1.discourse-cdn.com/flex016/uploads/hancom_dev_forum/original/1X/a6c7ec20b192a96c31825e1147e09be525d72e97.png)

바탕쪽 지울때 ‘지움’ / ‘취소’ 이렇게 두가지 중 선택하는 창이 한번 나오고

지운 다음에는  
현재 구역에 바탕쪽이 없습니다.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/hancom_dev_forum/original/1X/4bfbec2469a10c9f1299c04b95d8dc3b1380f41c.png)

이렇게 한번 나오는데 두가지 메시지 박스 모두 안나오게 할 수 있을까요?

## 아래는 c# 코드 입니다. 텍스트가 깨져서 이미지 캡쳐해서 올려요

 ![image](https://us1.discourse-cdn.com/flex016/uploads/hancom_dev_forum/original/1X/bb2b2e50ec26b276ee5b5007c0ca70d7193bee17.png)

---

<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월 26, 2023, 4:44오전 UTC](https://forum.developer.hancom.com/t/topic/697/2 "2023-05-26T04:44:04Z")

</div>

int 꺽쇄 열기/닫기가 네모 버튼으로 올라가네요…ㅠㅠ

---

<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월 31, 2023, 12:40오전 UTC](https://forum.developer.hancom.com/t/topic/697/3 "2023-05-31T00:40:33Z")

</div>

안녕하세요,

두가지 대화상자를 안띄우려면 아래와 같이 하면 안띄울수있습니다.

SetMessageBoxMode(0x00010001);

바탕쪽 지움에서 지움으로 하려면  
0x00010000  
취소는  
0x00020000  
입니다. 자리수를 맞춰주어야 합니다.

---

<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월 31, 2023, 2:50오전 UTC](https://forum.developer.hancom.com/t/topic/697/4 "2023-05-31T02:50:58Z")

</div>

‘현재 구역에 바탕쪽이 없습니다.’

이 창은 계속 뜨는데 왜 그럴까요?

코드는 알려주신대로 아래처럼 수정했습니다.

// 바탕쪽 지우기  
hwp.SetMessageBoxMode(0x00010010); // 메시지 박스 자동 확인 버튼

Debug.WriteLine(“메시지 박스 지우기 자동”);  
var act = hwp.CreateAction(“DeleteCtrls”); // 실행할 액션  
var set = act.CreateSet(); // 액션 Setting 값 변수 만들기  
act.GetDefault(set); // 기본값 가져오기

// 조판부호 목록들  
// 감추기=24, 꼬리말=14, 머리말=26, 바탕쪽=33, 새 쪽번호=45, 쪽번호=46, 쪽번호 위치=49, 메모=25  
// int jp\_ar = new int { 24, 14, 26, 33, 45, 46, 49, 25 }; // 조판부호 목록  
int jp\_ar = new int { 33 }; // 조판부호 목록  
var Pset = set.CreateItemArray(“DeleteCtrlType”, jp\_ar.Length); // 지울 조판부호 갯수 만큼 배열 만들기  
for (int i = 0; i \< jp\_ar.Length; i++)  
{  
Pset.SetItem(i, jp\_ar[i]); // 조판부모 목록 한개씩 추가하기  
}  
act.Execute(set); // 액션 실행  
hwp.SetMessageBoxMode(0xf0000); // 메시지 박스 원래대로  
Debug.WriteLine(“메시지 박스 지우기 원래대로” + 0xf0000.ToString()); ;

---

<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월 31, 2023, 4:01오전 UTC](https://forum.developer.hancom.com/t/topic/697/5 "2023-05-31T04:01:40Z")

</div>

> [@nuristar](#):
>
> 0x00010010

0x00010001\<–10001입니다 …ㅠㅠ 이렇게 처리한뒤 확인 부탁드립니다.

감사합니다.

---

<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월 31, 2023, 5:21오전 UTC](https://forum.developer.hancom.com/t/topic/697/6 "2023-05-31T05:21:17Z")

</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월 31, 2023, 4:41오후 UTC](https://forum.developer.hancom.com/t/topic/697/7 "2023-05-31T16:41:43Z")

</div>

다른 조판부호랑 같이 지울려고 하니까 잘 안됐었네요  
단순하게 아래 코드만 넣으니까 메시지박스도 안뜨고 잘 되네요  
제대로 알려주셨는데 제가 삽질하고 있었네요 ㅠㅠ

hwp.SetMessageBoxMode(0x00010001); // 메시지 박스 자동 확인 버튼  
hwp.HAction.GetDefault(“MasterPage”, hwp.HParameterSet.HMasterPage.HSet);  
hwp.HParameterSet.HMasterPage.Duplicate = 0;  
hwp.HParameterSet.HMasterPage.Front = 0;  
hwp.HParameterSet.HMasterPage.Type = 0;  
hwp.HAction.Execute(“MasterPage”, hwp.HParameterSet.HMasterPage.HSet);  
hwp.HAction.Run(“DeleteDocumentMasterPage”);  
hwp.SetMessageBoxMode(0xf0000); // 메시지 박스 원래대로

---

<div class="post-metadata">

**Author:** ![anon32007557](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@anon32007557](https://forum.developer.hancom.com/u/anon32007557)\
**Post date:** [6월 1, 2023, 9:17오전 UTC](https://forum.developer.hancom.com/t/topic/697/8 "2023-06-01T09:17:08Z")

</div>

참고로, 코드 예시를 올리실 때에는 ` 기호 세 개를 소스 앞뒤 줄에 써주시면 도움이 되실 겁니다. 기왕이면 언어도 같이 명시하시면 좋고요.  
(markdown 방식입니다)

* * *

(작성 예)

```
```c#
int[] jp_ar = new int[] { 33 };
```
```

(화면 표시)

```auto
int[] jp_ar = new int[] { 33 };

```
