Thread: [Solved] Check box values to text
View Single Post
 
Old 10-14-2013, 01:23 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

I'm not sure what you are trying to do exactly, however if you use the following method you will always write the string to the bookmark regardless if the string is null or not. Doing so always destroys and recreates the bookmark:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Word.Range
Dim strSomething As String
  Set oRng = ActiveDocument.Bookmarks("bmBookmarkName").Range
  oRng.Text = strSomething
  ActiveDocument.Bookmarks.Add "bmBookmarkName", oRng
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote