![]() |
|
|
|
#1
|
|||
|
|||
|
Charles I really appreciate your help, using your insights I am almost there. Is there any way to automate the Ctrl+Shift+F11 step?. The user will almost certain forget to do it. If a macro is the only way, could you provide some feedback on how to integrate with the autotext? Perhaps a macro that could be triggered after inserting an auto text and loop through all date fields and unlink them? Is that possible? In this document there is some information about macros that execute on document close: http://word.mvps.org/FAQs/MacrosVBA/DocumentEvents.htm Other question: I am really concern about the user experience, until now I just distribute a Word template (dotx) and all works wonderful. No special authorization or security warnings are shown. If I use a macro could I expect some warning? Thanks. Last edited by deepgreen; 01-20-2014 at 08:11 AM. |
|
#2
|
|||
|
|||
|
Quote:
You could include a MacroButton Field as a part of your AutoText entry. That could run a macro which deletes the macrobutton field and unlinks your fields that are entered. You could have a QAT button in your template to run a macro that itserts your AutoText and unlinks the fields. You could have your own AutoText gallery in your template and have a macro or macros that use that gallery in a custom ribbon tab. Customize the Ribbon (It doesn't take rocket science) This stuff can all be done. It depends on how much work you want to do. It may be simpler to train the user. Quote:
If you can get a macro to run the on-close event would work as a' handler so you would not have to get the user to intentionally do anything (except perhaps to allow macros to run). Graham Mayor has a page on Installing Macros that includes a macro to update all fields in a document. That could be converted to unlink Date fields. Note, it would unlink all date fields. Here is one I have not tested. It could be called by the document close event. Code:
Private Sub DateFieldUnlinkAllStory()
' Written by Charles Kyle Kenyon 20 January 2014
' help from Jezebel
' All Story Date Field Unlinker
Dim oField As Field
Dim oStory As Range
' On Error Resume Next
For Each oStory In ActiveDocument.StoryRanges
' This goes into headers and footers as well as the regular document
Do
For Each oField In oStory.Fields
If oField.Type = wdFieldDate Then
oField.Unlink
End If
Next oField
Set oStory = oStory.NextStoryRange
Loop Until oStory Is Nothing
Next oStory
End Sub
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
VBA code for Microsoft Word macro — select text and insert footnote
|
ndnd | Word VBA | 10 | 01-06-2015 01:47 PM |
How do i insert autotext using a contol toolbox checkbox
|
NP85 | Word VBA | 12 | 02-09-2014 03:06 PM |
| Word 2010 - AutoText | Medpack | Word | 0 | 12-10-2012 03:26 PM |
| Using Word autocorrect and autotext entries in outlook | dswapp | Outlook | 2 | 11-24-2010 10:18 AM |
| Merge Word 2003 AutoText to Word 2007 | damadhatter | Word | 0 | 10-15-2009 11:41 AM |