

Now go back to your Word document, do “Customize Quick Access Toolbar” and drag the flag icon to a convenient location on the bar. Add it to the right column which installs this icon in the Quick Access Toolbar. Scroll down this column until you find “Bookmark” (flag). Right click on the Quick Access Toolbar then left click on “Customize Quick Access Toolbar.” Be sure “All Commands” is selected in the drop down menu at the top of the left column. Set objTable2 = (Range:= putdown, but seems like a pretty simple solution. Set objRange2 = wdDoc.Bookmarks("table2").Range ' ' 'GoTo(What:=wdGoToBookmark, Name:="table2") Columns(3).SetWidth ColumnWidth:=60, RulerStyle:=wdAdjustNone Columns(2).SetWidth ColumnWidth:=340, RulerStyle:=wdAdjustNone Columns(1).SetWidth ColumnWidth:=30, RulerStyle:=wdAdjustNone ObjTable1.Rows(1).AllowBreakAcrossPages = True Set objTable1 = (Range:=, NumRows:=1, NumColumns:=3) Set objRange1 = wdDoc.Bookmarks("table1").Range ' ' 'GoTo(What:=wdGoToBookmark, Name:="table1") Set wdDoc = (ActiveWorkbook.Path & "\WOTest4.docx") MsgBox "Select Risk Level for line " & y + 1 Sub CommandButton14_Click() 'Create WO Letter ObjTable2.Columns(2).SetWidth ColumnWidth:=425, RulerStyle:= _Įven some reassurance that i am on the right track with this would be appreciated as I have been beating my head against this for the past week. ObjTable2.Columns(1).SetWidth ColumnWidth:=30, RulerStyle:= _

ObjTable1.Columns(3).SetWidth ColumnWidth:=75, RulerStyle:= _ ObjTable1.Columns(2).SetWidth ColumnWidth:=350, RulerStyle:= _

ObjTable1.Columns(1).SetWidth ColumnWidth:=30, RulerStyle:= _ ' ActiveWorkbook.Path & "\WOTest.docx", ReadOnly:=True '"\test.dotx", ReadOnly:=True'"\Doc.dotm", ReadOnly:=True '"\test.dotx", ReadOnly:=Trueįor Each riskCombo In (2).Frame15.Controls Set wdDoc = (ActiveWorkbook.Path & "\WOTest.docx") If (2).Frame15.Controls("Risk" & c).Value = "Risk" Then If Me.WOLetter1.Value = False And Me.WOLetter2.Value = False And Me.WOLetter3.Value = False And Me.WOLetter4.Value = False Then Private Sub CommandButton14_Click() 'Create WO Letter
VIEW BOOKMARKS IN WORD 2010 CODE
Here is the code I have so far, apologies in advance for any unused variables this is back of a napkin coding. If someone could give me some pointers on this I would greatly appreciated as I feel I am almost there but that I'm just overlooking something. I am convinced I am missing something in regards to cursor control (as the usual problem is the first table cell is created at the first line of the document then the cursor seems to move to the "table1" bookmark and the macro continues from there). So my problem is that when the macro is run it either creates one line of the table at the top of the document, another at the "table1" bookmark and one at the "table2" bookmark or the 3 column table is created then another 3 column table is created inside the first cell of the first table and so on. So basically at each bookmark if there are 3 lines of dynamic controls after the macro runs there should beĪ table with 3 rows and 3 columns located above bookmark "table1" containing the values from the first and second textbox and the combobox value.Ī table with 3 rows and 2 columns located above bookmark "table2" containing the values from the first and third textbox values. Inserts the values from the first and third textbox into columns 1 and 2 respectively.Create a table with 1 row and 2 columns.Go to a set bookmark in the Word Document ("table2").Return to the specified "table2" bookmark and repeat this for each iterated line of the dynamically created controls.Inserts the values from the first and second textboxes and combobox into columns 1,2 and 3 respectively.Create a table with 1 row and 3 columns.Move to the start of the line with the bookmark.Go to a set bookmark in the Word Document ("table1").I have written an Excel VBA Macro that should open up a specific document (which will be a dotx in the final version but is a docx for this test) and I have a userform that creates a set of controls (3 text boxes and a combo box) and interates a counter by 1 each time the button is pressed. I'm hoping someone can help me on this as I have been banging my head against this for about a week or so.
