![]() ![]() ![]() ![]() Sub GetHderFooterPics() Dim sec As Word.Section, HDFT As Word.HeaderFooter Dim i As Long For Each sec In ActiveDocument.Sections For Each HDFT In sec. Thanks for helping make community forums a great place. Below is a sample code that will find all images. We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. If this is no help, would you mind sharing a sample to reproduce this issue and find the reason? I could find the last table in the added page and the last line works fine. The code will add some text and a table, then insert a new page and add another table. ("This line should be on the next page.\n") inster a page break after the last word OTable = (wrdRng, 3, 5, ref oMissing, ref oMissing) = "This is some content for the word document.\nI am going to want to place a page break HERE\n" Application Wordapp = ĭocument oWordDoc = Wordapp.ActiveDocument Here is the sample from a VSTO project I made to test: private void button5_Click(object sender, RibbonControlEventArgs e) If yes, you can try to debug the code then find whether oWordDoc.Tables is existing or not. It contains three paragraphs containing one word each. First, we consider the file we will read. The requested member of the collection does not exist. With the assembly, we get the contents and formatting from the document. Have you got a message below while running the code you provided: According to your description, you want to know how to reference the last table of the document after a new page added. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |