Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 01-20-2014, 08:48 AM
Charles Kenyon Charles Kenyon is offline Insert identifiers in AutoText snippet. Microsoft word Windows 7 64bit Insert identifiers in AutoText snippet. Microsoft word Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,533
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Quote:
Originally Posted by deepgreen View Post

Is there any way to automate the Ctrl+Shift+F11 step?. The user will almost certain forget to do it.
Yes. It is called a macro.

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:
Originally Posted by deepgreen View Post
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.
This all depends on the level of control you have over the user settings. First, you do NOT want macro blocking turned off. You want your template and its code to be trusted. Can you put your template in a trusted location? Can you sign your template so that it will be trusted by the user's system?

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
That would not change CreateDate, SaveDate, or PrintDate fields.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert identifiers in AutoText snippet. Microsoft word VBA code for Microsoft Word macro — select text and insert footnote ndnd Word VBA 10 01-06-2015 01:47 PM
Insert identifiers in AutoText snippet. Microsoft word 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

Other Forums: Access Forums

All times are GMT -7. The time now is 01:10 AM.


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