Strange toolbar behavior

D

Dawn Rhoads

I have several toolbars with macros assigned to them. Two macros, for no
apparent reason I can figure, rearranges the toolbars when I run them. The
macros themsleves don't appear to have anything in them that would affect
toolbar positions. They are both used to convert fill-in form fields to
plain text -- one does the whole document, the other just does whatever is
selected. When either macro runs, it moves two of the custom toolbars from
one location to another. One toolbar has these macro assigned to it, the
other is a custom toolbar with other macros, but not these particular ones.
None of the other macros move toolbars around. The macros appears below, for
what it's worth. Anyone have any ideas what might be causing this?

Macro 1
ActiveDocument.PrintPreview
ActiveDocument.ClosePrintPreview
Selection.WholeStory
Selection.Fields.Unlink
Selection.HomeKey Unit:=wdStory

Macro 2
ActiveDocument.PrintPreview
ActiveDocument.ClosePrintPreview
Selection.Fields.Unlink
Selection.MoveLeft Unit:=wdCharacter, Count:=1
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?RGF3biBSaG9hZHM=?=,
Two macros, for no
apparent reason I can figure, rearranges the toolbars when I run them.
I'm guessing it's switching into and back out of PrintPreview that's causing
this. When you move into PrintPreview, the displayed toolbars change. They
change again when you close that view.
They are both used to convert fill-in form fields to
plain text -- one does the whole document, the other just does whatever is
selected.
I don't see why you need to change views in order to accomplish what you're
after? Are you just trying to make sure all the fields (besides form fields)
are updated? See if something along these lines works:

Dim rng as Word.Range

Set rng = ActiveDocument.Content
'Set rng = Selection.Range
rng.Fields.Update
rng.Fields.Unlink

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top