locked
Word 2010 - toggle design mode RRS feed

  • Question

  • Hello,

    I need a macro that will toggle design mode.  I found a bug with the placeholder text that is resolved once I open design mode and exit it. I've tried two macros that will hopefully accomplish this, but neither work.  Both just enter design mode, but don't exit it.  Advice would be greatly appreciated.  

    Sub Macro1()
    Application.ScreenUpdating = False
    ActiveDocument.ToggleFormsDesign
    ActiveDocument.ToggleFormsDesign
    Application.ScreenUpdating = True
    End Sub

    Sub Macro1()

    Dim temps as string
    Application.ScreenUpdating = False
    ActiveDocument.ToggleFormsDesign
    With Application.CommandBars("Exit Design Mode")
        temps = .Controls(1).Caption
    End With
    Application.ScreenUpdating = True
    End Sub

    Any ideas on what I'm doing wrong

    Monday, June 17, 2013 7:25 PM

All replies

  • Sorry for the confusing format in my post.  My two macro attempts looked much more differentiated when I was typing this post / question

    Monday, June 17, 2013 7:51 PM
  • I'm not exactly sure what you are after but to determine if the toggle should be off or on you have to put a condition one it.

        If ActiveDocument.FormsDesign = False Then
            ActiveDocument.ToggleFormsDesign
        End If
    


    Kind Regards, Rich ... http://greatcirclelearning.com

    Monday, June 17, 2013 10:48 PM
  • Rich,

    Thank you for your help.  That code wont wont work.  I can't remember why, but I remember reading in another forum or thread the reason, but I can't remember it. 

    Also to be clear.  I can write one macro that will take me into design mode and one macro to take me out of it.  But, I can't write one macro that will do both in an desired order.

    The reason why I want to do this is because I'm having problems with my place holder text (http://social.technet.microsoft.com/Forums/en-US/word/thread/8f50ad9d-a56c-4fb9-b31e-8860648c267b) and this entering design mode and immediately exiting seems to fix the problem.

    Bests,

    Tyler

    Tuesday, June 18, 2013 3:28 PM