visual studio 2010 - How to Insert a Table as a Word Header using vb.net -


I'm trying to insert a table at the top of the word, but instead of placing it in the table, be made in the table. The body of the page is

I have tried to do it,

> objapp Application obogDoc as Word.Document objApp = New Word.Application () objDoc = objApp. Documents.Open (TextBox1.Text) objDoc.Sections (1) .PageSetup.DifferentFirstPageHeaderFooter = true objDoc.Sections (1) .Headers (Word.WdHeaderFooterIndex.wdHeaderFooterFirstPage) .Range.Tables.Add (range: = objApp.Selection.Range , numrows: = 3, NumColumns: = 1) objDoc.Save () objDoc.Close () objApp.Quit () as dim oWord = new Microsoft.Office.Interop.Word.Application dim again string = System.Environment.GetFolderPath in (Environment.SpecialFolder.MyDocuments) oWord.Documents.Open (TextBox1.Text) Word.Table = oDoc.Tables retarded oDoc = oWord.ActiveDocument oWord.Visible = true dim tbl (1) tbl.Cell (1, 1) .Range not Ext = "content" tbl.Cell (2, 1) .Range.Text = "content" tbl.Cell (3, 1) .Range.Text = "Total Exposure:" oDoc.Save () oDoc.Close () Order .Quit ()

Any help really appreciated Will be given.

ojDoc.Sections (1). Header (Word.WdHeaderFooterIndex.wdHeaderFooterFirstPage) .Range. Tables.Add (range: = objApp.Selection.Range, numrows: = 3, NumColumns: = 1)

If you are trying to create a new table anchors the selection, but he It is possible that the title is not inside.
It seems to work:

  In the form of a slow R word. Range = objDoc.Sections (1). Header (Word.WdHeaderFooterIndex.wdHeaderFooterFirstPage) .Range r.Tables.Add (range: = r, numrows: = 3, NumColumns: = 1)  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -