Merhaba arkadaşlar,

Word dosyasının ust bilgi (header) kısmına 2 paragraf yazıp istediğim gibi duzenlemek istiyorum ama bir turlu yapamadım. Paragraf eklemeye calışıyorum sonra yeni bir metin yazınca uzerine yazıyor. Artı ust bilgi duzenlemesi yaparken verileri santimetre cinsinden giremiyorum. Yardımcı olursanız sevinirim. Calıştığım kodlar aşağıda.

Referanslarım:
Imports Microsoft.Office.Interop.Word
Imports Microsoft.Office.Interop

program
ultimate 2013 (visual basic)
.net framework 2.0


İstediğim : Ust bilgiyi istediğim gibi duzenlemek. Ust bilgiye en az iki paragraf eklemek. Birinci paragraf 10 punto olacak ikinci paragrafta "sınıf" kalın 18 punto "ad soyad" italik 10 punto şeklinde olacak. Kafayı yemek uzereyim yardımcı olursanız sevinirim.








oWord = CreateObject("Word.Application") 'word uygulamasını oluşturuyoruz.
oWord.Visible = True 'uygulamanın gizli ya da gorunur olması
oDoc = oWord.Documents.Open("C:\a.docx")


oDoc.PageSetup.LineNumbering.Active = False
oDoc.PageSetup.Orientation = WdOrientation.wdOrientPortrait

If oDoc.PageSetup.TopMargin < 60 Then
oDoc.PageSetup.TopMargin = 60
End If
oDoc.PageSetup.Gutter = 0
oDoc.PageSetup.PaperSize = WdPaperSize.wdPaperA4
oDoc.PageSetup.HeaderDistance = 15
oDoc.PageSetup.FooterDistance = WdHeaderFooterIndex.wdHeaderFooterFirstPage
oDoc.PageSetup.OtherPagesTray = WdPaperTray.wdPrinterDefaultBin
oDoc.PageSetup.SectionStart = WdSectionStart.wdSectionNewPage
oDoc.PageSetup.OddAndEvenPagesHeaderFooter = False
oDoc.PageSetup.DifferentFirstPageHeaderFooter = False
oDoc.PageSetup.VerticalAlignment = WdVerticalAlignment.wdAlignVerticalTop
oDoc.PageSetup.SuppressEndnotes = False
oDoc.PageSetup.MirrorMargins = False
oDoc.PageSetup.TwoPagesOnOne = False
oDoc.PageSetup.BookFoldPrinting = False
oDoc.PageSetup.BookFoldRevPrinting = False
oDoc.PageSetup.BookFoldPrintingSheets = 1
oDoc.PageSetup.GutterPos = WdGutterStyle.wdGutterPosLeft
oDoc.PageSetup.SectionDirection = WdSectionDirection.wdSectionDirectionLtr



oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.LeftIndent = 0
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.RightInden t = 0
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.SpaceBefor e = 0
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.SpaceBefor eAuto = False
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.SpaceAfter = 0
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.SpaceAfter Auto = False
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.LineSpacin g = 25
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.WidowContr ol = True
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.KeepWithNe xt = False
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.KeepTogeth er = False
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.PageBreakB efore = False
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.NoLineNumb er = False
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.Hyphenatio n = True
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.FirstLineI ndent = 0
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.CharacterU nitLeftIndent = 0
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.CharacterU nitRightIndent = 0
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.CharacterU nitFirstLineIndent = 0
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.LineUnitBe fore = 0
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.LineUnitAf ter = 0
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.ParagraphFormat.MirrorInde nts = False



oDoc.ActiveWindow.ActivePane.View.SeekView = WdSeekView.wdSeekMainDocument
oDoc.PageSetup.DifferentFirstPageHeaderFooter = False
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.WholeStory()
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.Text = "deneme1111111111111111111"
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.Paragraphs.Add()
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.InsertParagraphBefore()
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.Text = "deneme2222222222222222222"
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.Paragraphs.Add()
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.InsertParagraphBefore()
oDoc.Sections(1).Headers(WdHeaderFooterIndex.wdHea derFooterPrimary).Range.Text = "deneme33333333333333"

oDoc.PrintOut()
oDoc.Save()
oDoc.Close()
oWord.Quit()
__________________