Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 05-24-2012, 05:04 AM
jjfreedman jjfreedman is offline Retrieving content control value Windows 7 64bit Retrieving content control value Office 2010 32bit
Advanced Beginner
 
Join Date: May 2012
Location: https://jay-freedman.info
Posts: 39
jjfreedman is on a distinguished road
Default

The simplest way to change the arrangement of the dates is to use the Format function. I'd recommend that you look up the Help topic about this function to see all the things it can do (easy: after you type Format in the macro window, put the cursor inside the word and press F1). For this specific case, what you need is

Dim FBdate As String
FBdate = ActiveDocument.ContentControls(3).Range.Text
FBDate = Format(FBDate, "yyyy mmdd")

At that point FBDate will have the proper form, and you can use it to make a file name.

If you need to do other things with the date, such as adding days or months to it, investigate the data type named Date and the function CDate that converts strings to Date objects.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving content control value Move to next content control cksm4 Word VBA 13 07-02-2019 07:48 PM
retrieving notes in outlook that were deleted donbmar Outlook 0 05-21-2011 12:18 PM
Retrieving content control value content control Word 2007 TessaLee Word 1 03-11-2011 12:51 AM
Package for CD with links to Windows media player content and Flash Shockwave content hectorh PowerPoint 4 10-15-2009 12:22 PM
Templates: automatic text generation from Rich Text content control Chickenmunga Word 0 10-01-2008 11:16 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:40 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft