• macropod

    macropod

    @macropod

    Viewing 15 replies - 31 through 45 (of 5,023 total)
    Author
    Replies
    • in reply to: Word Relative Field Paths Discussion #1598128

      That suggests the document is being opened from OneDrive, not from your local drive. Moreover, the code you’ve posted is missing the from:
      NewPath = .Path & “”

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • in reply to: Word Relative Field Paths Discussion #1598126

      Try deleting the three problem ‘End If’ lines. Code updated

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • in reply to: Word Relative Field Paths Discussion #1598114

      Try replacing the UpdateFields macro with:

      Code:
      Private Sub UpdateFields()
      ' This routine sets the new path for external links, pointing them to the current folder.
      Dim Rng As Range, Fld As Field, Shp As Shape, iShp As InlineShape, i As Long, NewPath As String
      ' Go through all story ranges in the document.
      With ThisDocument
        NewPath = .Path & ""
        For Each Rng In .StoryRanges
          ' Go through the shapes in the story range.
          For Each Shp In Rng.ShapeRange
            With Shp
              ' Skip over shapes that don't have links to external files.
              If Not .LinkFormat Is Nothing Then
                With .LinkFormat
                    .SourceFullName = NewPath & .SourceName
                    On Error Resume Next
                    .AutoUpdate = False
                    On Error GoTo 0
                End With
              End If
            End With
          Next Shp
          ' Go through the inlineshapes in the story range.
          For Each iShp In Rng.InlineShapes
            With iShp
              ' Skip over inlineshapes that don't have links to external files.
              If Not .LinkFormat Is Nothing Then
                With .LinkFormat
                    .SourceFullName = NewPath & .SourceName
                    On Error Resume Next
                    .AutoUpdate = False
                    On Error GoTo 0
                End With
              End If
            End With
          Next iShp
          ' Go through the fields in the story range.
          For Each Fld In Rng.Fields
            With Fld
              ' Skip over fields that don't have links to external files.
              If Not .LinkFormat Is Nothing Then
                With .LinkFormat
                    .SourceFullName = NewPath & .SourceName
                    On Error Resume Next
                    .AutoUpdate = False
                    On Error GoTo 0
                End With
              End If
            End With
          Next Fld
        Next Rng
        .Save
      End With
      End Sub

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • in reply to: Word Relative Field Paths Discussion #1598104

      If you’re linking to a file stored on OneDrive, why would you need to make the path relative. More specifically, to what would it be relative?

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • in reply to: Word Relative Field Paths Discussion #1598034

      As has been suggested before (see /showthread//183852-Word-Fields-and-Relative-Paths-to-External-Files-Problem?p=1099410&viewfull=1#post1099410) you should be able to resolve that by turning off the ‘update automatic links at open’ option (File|Options|Advanced>General).

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • See post #2, above.

      For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
      For Mac macro installation & usage instructions, see: https://wordmvp.com/Mac/InstallMacro.html

      The macro would be added to the ‘ThisDocument’ code module of the document or its template.

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • Provided your mailmerge main document is set up correctly, the TableJoiner macro should work just as well with that kind of table.

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • The tutorial does tell you how to deal with that, under ‘Merging to Tables’…

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • You could use a macro like the following to both retrieve a shape’s current name and to rename it:

      Code:
      Sub ShapeReNamer()
      Dim Result As String
      With Selection
        If .Type = wdSelectionShape Then
          With .ShapeRange(1)
            Result = InputBox("Please give this shape (" & .Name & _
              ") a meaningful name", "Rename Shape", .Name)
            If Result = .Name Then Exit Sub
            .Name = Result
          End With
        End If
      End With
      End Sub

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • There are numerous approaches that could be taken. For example, in webmistress’ document, all the images were positioned behind the text. If there had been other images that weren’t behind the text and were to remain visible, one could test that property. Another approach might be to use the relative location of the shape in the document (e.g. Shapes 1 & 3). Yet another approach is to name the images, then toggle the visibility by reference to the name. And, of course, there’s the alternative text method you’ve employed.

      As for inline shapes, they’re InlineShape objects – not Shape objects – and would have to be handled as such. Since the images to be processed were all Shape objects, there was no need to include any code regarding InlineShape objects.

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • OK, try this alternative approach. It should hide/unhide the shapes without the need for toggling the font visibility and shouldn’t affect the layout.

      Code:
      Sub Demo()
      Application.ScreenUpdating = False
      Dim Shp As Shape
      For Each Shp In ActiveDocument.Shapes
        Shp.Visible = Not Shp.Visible
      Next
      Application.ScreenUpdating = True
      End Sub

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • in reply to: Code to extract individual pages as separate files #1593879

      IF the documents are exactly as he hopes that they are.

      Hardly an issue in this case. The output specs are quite clear: one new document per manual page break in the source files.

      So how about we wait until the OP actually says the solution I suggested doesn’t work instead of continuing this rather pointless speculation???

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • Whether you’ll see any difference on screen depends on whether you have Word’s hidden text display ‘on’. Clicking on the ¶ symbol on the Ribbon’s Home tab toggles Word’s hidden text display ‘on/off’.

      Here’s a more refined version of the macro, which works better if you have Word’s hidden text display ‘off’ and you want to unhide the images:

      Code:
      Sub Demo()
      Application.ScreenUpdating = False
      Dim Shp As Shape, bView As Boolean
      bView = ActiveWindow.ActivePane.View.ShowAll
      ActiveWindow.ActivePane.View.ShowAll = True
      For Each Shp In ActiveDocument.Shapes
        With Shp.Anchor.Characters.First.Font
          .Hidden = Not .Hidden
        End With
      Next
      ActiveWindow.ActivePane.View.ShowAll = bView
      Application.ScreenUpdating = True
      End Sub

      Note: You can get some interesting effects if you hide some images, then add more (visible) images to the document. Running the macro will then hide one set while displaying the other…

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • Try the following macro, which toggles the visibility of your images. Running it once hides them; running it again unhides them.

      Code:
      Sub Demo()
      Application.ScreenUpdating = False
      Dim Shp As Shape
      For Each Shp In ActiveDocument.Shapes
        With Shp.Anchor.Characters.First.Font
          .Hidden = Not .Hidden
        End With
      Next
      Application.ScreenUpdating = True
      End Sub

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • in reply to: Word 2016 MailMerge, currency problem #1593558

      I had to change the , for a ; in the MOD function. I guess it has to do with the French version of Word that I am using.

      Yes, that’s a fairly common requirement.

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    Viewing 15 replies - 31 through 45 (of 5,023 total)