L
LEU
I have the following that is part of my macro that goes into a table and get
some text. I thought the way I have it written it would delete the hard
return at the end. But when I load it into a bookmark there is a hard return
at the end still. Is there a way to delete this hard return so all I have in
the bookmarks is the text?
Getting the text:
With ActiveDocument.Tables(1)
strWord6 = .Cell(1, 3).Range.Text
strWord6 = Mid(strWord6, 1, Len(strWord6) - 2)
strWord8 = .Cell(3, 2).Range.Text
strWord8 = Mid(strWord8, 1, Len(strWord8) - 2)
strWord9 = .Cell(3, 5).Range.Text
strWord9 = Mid(strWord9, 1, Len(strWord9) - 2)
End With
Loading text into bookmark:
If ActiveDocument.Bookmarks.Exists("bkDate") Then
Set myrange = ActiveDocument.Bookmarks("bkDate").Range
myrange.Text = strWord6
ActiveDocument.Bookmarks.Add "bkDate", myrange
End If
If ActiveDocument.Bookmarks.Exists("bkDic") Then
Set myrange = ActiveDocument.Bookmarks("bkDic").Range
myrange.Text = strWord8
ActiveDocument.Bookmarks.Add "bkDic", myrange
End If
If ActiveDocument.Bookmarks.Exists("bkPCN") Then
Set myrange = ActiveDocument.Bookmarks("bkPCN").Range
myrange.Text = strWord9
ActiveDocument.Bookmarks.Add "bkPCN", myrange
End If
LEU
some text. I thought the way I have it written it would delete the hard
return at the end. But when I load it into a bookmark there is a hard return
at the end still. Is there a way to delete this hard return so all I have in
the bookmarks is the text?
Getting the text:
With ActiveDocument.Tables(1)
strWord6 = .Cell(1, 3).Range.Text
strWord6 = Mid(strWord6, 1, Len(strWord6) - 2)
strWord8 = .Cell(3, 2).Range.Text
strWord8 = Mid(strWord8, 1, Len(strWord8) - 2)
strWord9 = .Cell(3, 5).Range.Text
strWord9 = Mid(strWord9, 1, Len(strWord9) - 2)
End With
Loading text into bookmark:
If ActiveDocument.Bookmarks.Exists("bkDate") Then
Set myrange = ActiveDocument.Bookmarks("bkDate").Range
myrange.Text = strWord6
ActiveDocument.Bookmarks.Add "bkDate", myrange
End If
If ActiveDocument.Bookmarks.Exists("bkDic") Then
Set myrange = ActiveDocument.Bookmarks("bkDic").Range
myrange.Text = strWord8
ActiveDocument.Bookmarks.Add "bkDic", myrange
End If
If ActiveDocument.Bookmarks.Exists("bkPCN") Then
Set myrange = ActiveDocument.Bookmarks("bkPCN").Range
myrange.Text = strWord9
ActiveDocument.Bookmarks.Add "bkPCN", myrange
End If
LEU