2011-12-21 2 views
0

내가 Word 2007을텍스트를 다른 형식으로 바꾸는 방법은 무엇입니까?

Document.Content.Find.Execute("Subject/ Title:", , , , , , , , , "Subject/ Title: Insert Subject here") 

2003 + 자동화 VB.net을 사용하고는 그 위의 코드 내 프로젝트에 매우 유용하다 발견했다. 첫 번째 문자열을 두 번째 문자열로 바꿉니다. 하지만 지금은 코드를 한 단계 더 이전해야합니다. 콜론 뒤에있는 텍스트에 밑줄을 긋고 싶습니다. 범위를 사용하려고했지만 작동하지 않았습니다. 어떤 형태의 도움을 주시면 감사하겠습니다!

두 번째로, 첫 번째 장소에서 검색 할 텍스트가있는 경우에만 작동합니다. 빈 셀에 텍스트를 넣고 싶습니다. 프로그래밍 방식으로 셀을 찾으려면 어떻게해야합니까? 이것이 도움이된다면 문서의 두 번째 행에있는 두 번째 테이블입니다.

답변

0

다른 문자열에 콜론 뒤에 텍스트를 넣어야한다고 생각합니다. 이 같은 쓰기 : http://msdn.microsoft.com/en-us/library/ms752372.aspx#Y1178

+0

.NET 프레임 워크 4. 난 아직 1.1을 사용하고 있습니다위한거야 : 내가 찾은

' Use a Red pen for the underline text decoration. Private Sub SetRedUnderline() ' Create an underline text decoration. Default is underline. Dim myUnderline As New TextDecoration() ' Create a solid color brush pen for the text decoration. myUnderline.Pen = New Pen(Brushes.Red, 1) myUnderline.PenThicknessUnit = TextDecorationUnit.FontRecommended ' Set the underline decoration to a TextDecorationCollection and add it to the text block. Dim myCollection As New TextDecorationCollection() myCollection.Add(myUnderline) TextBlock2.TextDecorations = myCollection End Sub 

위의 코드는 TextDecoration 클래스를 사용을, 당신은 여기에 추가로 문서를 볼 수 있습니다. 대안이 있습니까? 나는 그것이 밑줄을 그어 줄 필요가있다. –

+0

.NET 3.0 프레임 워크에서 TextDecoration 클래스를 사용할 수 있다고 생각합니다. – uday

+0

나는 1.1을 사용하고있다. 개체에 텍스트 + 글꼴을 설정하고 "바꾸기"기능을 사용할 수 있습니까? 또는 문자열을 문서에서 "검색"하여 밑줄로 설정하는 것이 더 낫습니까? –

관련 문제