Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-02-2017, 05:55 AM
gmayor's Avatar
gmayor gmayor is offline Strange macro behavior in 2016 Windows 10 Strange macro behavior in 2016 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

An autotext as suggested by Charles would do the job, or you could use a simple macro
Code:
Sub InsertDateandTime()
Dim orng As Range
    Set orng = Selection.Range
    orng.ParagraphFormat.Alignment = wdAlignParagraphLeft
    orng.Text = Format(Date, "d mmmm yyyy") & vbCr & Format(Time, "hh:mm am/pm")
    orng.Collapse 0
    orng.Select
lbl_Exit:
    Set orng = Nothing
    Exit Sub
End Sub
Change the date and time formats as required.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange macro behavior in 2016 Excel for Mac 2016 - Macro issue theUKshrew Excel Programming 1 02-10-2017 11:16 PM
Strange macro behavior in 2016 Strange OLE Link Behavior after emailing or moving a File ptmuldoon Word 1 12-03-2014 02:28 PM
Strange macro behavior in 2016 Microsoft Office Windows Strange Behavior jg60 Word 8 06-14-2012 09:51 AM
Outlook Auto-Reply Rule - Strange behavior albracco Outlook 5 09-27-2011 08:18 AM
Strange macro behavior in 2016 Pasting - strange behavior SatControl Word 5 02-14-2010 12:57 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:22 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