View Single Post
 
Old 04-29-2014, 06:57 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

All you need do is specify the output format of 'dtDateFiled.Value'. However, as written, your code also doesn't allow the date to be updated within the bookmark and lacks error-handling. Try:
Code:
Private Sub cmdOK_Click()
Application.ScreenUpdating = False
Dim BmkNm As String, NewTxt As String, BmkRng As Range
BmkNm = "DateFiled"
With ActiveDocument
  If .Bookmarks.Exists(BmkNm) Then
    Set BmkRng = .Bookmarks(BmkNm).Range
    BmkRng.Text = Format(dtDateFiled.Value, "MMMM DD, YYYY ")
    .Bookmarks.Add BmkNm, BmkRng
  Else
    MsgBox "Bookmark: " & BmkNm & " not found."
  End If
End With
Set BmkRng = Nothing
Application.ScreenUpdating = True
Unload Me
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote