![]() |
|
#17
|
|||
|
|||
|
No need. I think I get it. Try this on your word document. Ignore the spreadsheet for the moment. See if you get what you want. Use Ctrl-Z to undo if necessary.
Code:
Sub expand_bookmark_to_include_insertion()
Dim bk As Bookmark
Dim new_range As Range
Set bk = ActiveDocument.Bookmarks(1)
Dim bk_name As String: bk_name = bk.Name
Set new_range = ActiveDocument.Range(bk.Start, bk.End)
new_range.InsertAfter (vbCrLf & "Inserted text")
bk.Delete
Dim bk_new As Bookmark
Set bk_new = Bookmarks.Add(bk_name, new_range)
End Sub
|
| Tags |
| bookmark, if statement, vba |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Pasting table data so that it will wrap around the table
|
rebmaboss | Word | 1 | 11-25-2016 02:30 AM |
| Pasting text from Excel cell into word without creating a table, and keeping the in-cell formatting | hanvyj | Excel Programming | 0 | 08-28-2015 01:15 AM |
| How to insert a table using bookmarks in a document | Catty | Word VBA | 3 | 05-04-2015 03:05 AM |
Table of Bookmarks
|
Niy | Word | 3 | 03-28-2012 12:18 AM |
| Pasting table in Photoshop cutting off table | azdolfan | Word Tables | 0 | 05-16-2010 01:52 PM |