By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

Export to word date format

P: n/a
jpr
Friend, I am using a code to export data from a table to a word
document using bookmarks and have a problem with a date format.
When I export a field that is a mm/dd, in my word doc it shows up with
the format mm/dd/yyyy. Is there a way I can export to show the format
mm/yyyy?

This is the code:

objWord.ActiveDocument.Bookmarks("purgedate").Sele ct
If Err.Number = 0 Then
objWord.Selection.Text = Me.purgedate
Else
Err.Number = 0
End If

Any help?

Apr 19 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
jpr wrote:
Friend, I am using a code to export data from a table to a word
document using bookmarks and have a problem with a date format.
When I export a field that is a mm/dd, in my word doc it shows up with
the format mm/dd/yyyy. Is there a way I can export to show the format
mm/yyyy?

This is the code:

objWord.ActiveDocument.Bookmarks("purgedate").Sele ct
If Err.Number = 0 Then
objWord.Selection.Text = Me.purgedate
Else
Err.Number = 0
End If

Any help?


objWord.Selection.Text = Format(Me.purgedate,"mm/yy")
Apr 19 '06 #2

P: n/a
jpr
thanks. works fine.

Apr 19 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.