그래서 내 자신의 질문에 대답합니다. 현재 활성 문서와 머리글에서 "머리글"을 얻을 수 있지만 맨 위에있는 것처럼 보이지만 실제로는 아무 것도 저장할 수있는 전체 문서에 걸쳐 있습니다 (어도비 사진관의 레이어라고 생각할 수 있음). 어쨌든이 헤더 레이어에 삽입하고 텍스트 상자를 세로로 정렬하려면 다음을 사용하십시오.
//note: we are in ThisAddin.cs (word addin) and this.Application = word addin
private void drawTdCycleTextBox(String cycleCode)
{
int length = 1000;
// get the current cursor location
Range cursorRange = this.Application.Selection.Range;
// get the primary header on the current page
HeaderFooter header = this.Application.ActiveDocument.Sections.First.Headers[Word.WdHeaderFooterIndex.wdHeaderFooterPrimary];
// header.Range.Text = "THIS IS A TEST";
// create the textbox inside the header and at the current cursor location
Microsoft.Office.Interop.Word.Shape textBox = header.Shapes.AddTextbox(Office.MsoTextOrientation.msoTextOrientationUpward, 0, 0, 35, length, cursorRange);
textBox.TextFrame.TextRange.Font.Size = 20;
textBox.TextFrame.TextRange.Text = Util.repeatedTextOutput(cycleCode, 25, length);
textBox.Fill.ForeColor.RGB = ColorTranslator.ToOle(Color.Turquoise);
textBox.Fill.Transparency = .35F;
}