none
Macro to activate word text boundaries not working RRS feed

  • Question

  • Hi,

    I am trying to run a macro , where the macro will apply text boundaries to all the word 2010 documents placed in a folder. the Macro is running very well. BUT when i open any of the word file in another PC , the text boundaries are not reflecting where in my PC the text boundaries are reflecting !!. I need the Macro which will reflect the changes in the file permanently.

    Th Text boundary needs to be activated manualy by going in File ->Option -> Advanced -> go to Show document content  -> & click on the option Show Text boundaries.

    Below is the code...

    Sub ProcessFolder()
        ' Change as needed but keep \ at the end
        Const strFolder = "C:\Check_1\"
        Dim strFile As String
        Dim doc As Document
        strFile = Dir(strFolder & "*.doc*")
        Do While strFile <> ""
            Set doc = Documents.Open(strFolder & strFile)
            Call RunAll
            doc.Close SaveChanges:=True
            strFile = Dir
        Loop
    End Sub
    Sub RunAll()
       
       
        Call show_boundary
           
    End Sub

    Sub show_boundary()
    '
    ' show_boundary Macro
    '
    '
        ActiveWindow.View.ShowTextBoundaries = True
    End Sub


    ALI

    Wednesday, December 26, 2012 1:17 PM

Answers

  • Yes, the setting for displaying non-printing characters such as the paragraph mark ¶ is an application-level setting too, not a document-level setting.

    Regards, Hans Vogelaar

    Wednesday, December 26, 2012 10:44 PM
  • The project condition says that Both the text boundaries & Pilcrows should be on while submitting the project.


    That is a meaningless condition, as whether the user preparing the submission has those options 'on' has no effect on the actual submission and cannot be discerned from the document content. These are user display options that affect how Word displays documents, not their content, and apply at the application level, not at the document level.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Thursday, December 27, 2012 7:42 AM

All replies

  • Hi Ali

    The option to display (or not) text boundaries is a user configuration setting. It can't be set as part of the document. Either all documents open with text boundaries displayed or none.

    The only way you could achieve this would be a very complex set of macros as part of the document. In essence, the tool would have to monitor the DocumentChange event of the Word application and turn the setting on / off depending on which document the user switches to.


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, December 26, 2012 1:54 PM
    Moderator
  • Displaying text boundaries is not a property of a document. It is a personal preference, an application-level view setting. If you turn on "Show text boundaries", it will apply to all documents that you open or create from then on, until you turn it off again. So there is no point in processing all documents in a folder.

    When another user opens your document, that user's setting for "Show text boundaries" will apply, not your setting.


    Regards, Hans Vogelaar

    Wednesday, December 26, 2012 2:10 PM
  • Thanks for the guidance , but I am trying to apply the macro for pilcrows also.

    The project condition says that Both the text boundaries & Pilcrows should be on while submitting the project.

    I have tried opening the document in my friend PC and the Pilcrows & the text boudaries are not showing....

    Does the an application-level view setting applies to PILCROWS also... kindly guide


    ALI

    Wednesday, December 26, 2012 4:59 PM
  • Yes, the setting for displaying non-printing characters such as the paragraph mark ¶ is an application-level setting too, not a document-level setting.

    Regards, Hans Vogelaar

    Wednesday, December 26, 2012 10:44 PM
  • The project condition says that Both the text boundaries & Pilcrows should be on while submitting the project.


    That is a meaningless condition, as whether the user preparing the submission has those options 'on' has no effect on the actual submission and cannot be discerned from the document content. These are user display options that affect how Word displays documents, not their content, and apply at the application level, not at the document level.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Thursday, December 27, 2012 7:42 AM
  • Thanks for the reply... I checked with the project guys & they have accepted their mistake. they will accept the project without this conditions..

    Thanks for all the support...


    ALI

    Monday, December 31, 2012 6:17 AM