Results 1 to 1 of 1

LinkFormat.BreakLink in Publisher

Threaded View

  1. #1
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    LinkFormat.BreakLink in Publisher

    What am I trying to do?
    - Several "Publisher Documents" contain chart images that are linked to a single Excel file
    - The Excel fle is updated and VBA (in Excel) is then used to update the Publisher Documents
    - After making amendments to the linked shapes I want to break all the links in the Publisher documents
    - Which sounds simple enough ...

    This POWERPOINT example from Microsoft shows how to update and then break the links to any shapes that are linked to OLE objects on slide one in the active presentation.
    Public Sub BreakLink_Example()
        Dim pptShape As Shape
        For Each pptShape In ActivePresentation.Slides(1).Shapes
            With pptShape
                If .Type = msoLinkedOLEObject Then
                    .LinkFormat.Update
                    .LinkFormat.BreakLink
                End If
            End With
        Next pptShape
    End Sub
    Using the same logic and structure, this should work with Publisher, but it does not
        Dim shp As Object, p As Integer, s As Integer
        For p = 1 To pDoc.Pages.Count
            For s = 1 To pDoc.Pages(p).Shapes.Count
                Set shp = pDoc.Pages(p).Shapes(s)
                If shp.Type = pbLinkedOLEObject Then 
                   shp.LinkFormat.Update     THIS WORKS FINE
                   shp.LinkFormat.BreakLink  THE CODE BREAKS HERE
    	    End If
            Next s
        Next p
    .LinkFormat.BreakLink simply does not appear to be available in Publisher
    (it is odd that .LinkFormat.Update does what you would expect, but that .BreakLink is not available)

    Is anyone aware of VBA code that will simply break ALL links in a Publisher file
    - This is the final piece in the jigsaw to solve this thread and the code I am trying to modify is in post#12
    thanks
    Last edited by kev_; 01-07-2018 at 12:14 PM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. What about Publisher?
    By Lennnny in forum The Water Cooler
    Replies: 4
    Last Post: 12-16-2013, 04:43 PM
  2. [SOLVED] BreakLink Function error
    By lottidotti in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-12-2013, 06:30 PM
  3. Trust Publisher
    By jwongsf in forum Excel General
    Replies: 5
    Last Post: 03-31-2010, 01:17 PM
  4. Merge into Publisher
    By Cathy Brausa in forum Excel General
    Replies: 1
    Last Post: 06-16-2008, 02:50 PM
  5. Merge into Publisher
    By Cathy Brausa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-16-2008, 02:47 PM
  6. Matching publisher code with the publisher
    By bearaman in forum Excel General
    Replies: 2
    Last Post: 03-19-2008, 01:13 PM
  7. [SOLVED] Publisher 2003
    By ben_yo_24 in forum Excel General
    Replies: 0
    Last Post: 03-17-2006, 02:30 AM
  8. Why these commands make erros? (Breaklink and SaveAs)
    By pauloreiss in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-04-2006, 11:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1