-
macropod
AskWoody_MVPThat 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] -
macropod
AskWoody_MVPTry deleting the three problem ‘End If’ lines. Code updated
Cheers,
Paul Edstein
[Fmr MS MVP - Word] -
macropod
AskWoody_MVPTry 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] -
macropod
AskWoody_MVPIf 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] -
macropod
AskWoody_MVPAs 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] -
macropod
AskWoody_MVPFebruary 2, 2019 at 11:48 pm in reply to: Calculating the difference between two Date Picker Content Control #1598019See 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.htmlThe macro would be added to the ‘ThisDocument’ code module of the document or its template.
Cheers,
Paul Edstein
[Fmr MS MVP - Word] -
macropod
AskWoody_MVPApril 6, 2017 at 4:35 pm in reply to: Understanding Microsoft Word Catalogue/Directory Mailmerge Tutorial Post #1594319Provided 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] -
macropod
AskWoody_MVPApril 6, 2017 at 2:28 am in reply to: Understanding Microsoft Word Catalogue/Directory Mailmerge Tutorial Post #1594310The tutorial does tell you how to deal with that, under ‘Merging to Tables’…
Cheers,
Paul Edstein
[Fmr MS MVP - Word] -
macropod
AskWoody_MVPMarch 23, 2017 at 4:49 pm in reply to: WORD (Office 365 version) Record macro to hide specific (not all) images #1594098You 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] -
macropod
AskWoody_MVPMarch 22, 2017 at 5:55 pm in reply to: WORD (Office 365 version) Record macro to hide specific (not all) images #1594072There 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] -
macropod
AskWoody_MVPMarch 21, 2017 at 3:04 am in reply to: WORD (Office 365 version) Record macro to hide specific (not all) images #1593948OK, 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] -
macropod
AskWoody_MVPIF 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] -
macropod
AskWoody_MVPMarch 19, 2017 at 11:48 pm in reply to: WORD (Office 365 version) Record macro to hide specific (not all) images #1593833Whether 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] -
macropod
AskWoody_MVPMarch 17, 2017 at 1:25 am in reply to: WORD (Office 365 version) Record macro to hide specific (not all) images #1593562Try 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] -
macropod
AskWoody_MVPI 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]
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
1 hour, 38 minutes ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
1 hour, 44 minutes ago -
regarding april update and may update
by
heybengbeng
3 hours, 14 minutes ago -
MS Passkey
by
pmruzicka
49 minutes ago -
Can’t make Opera my default browser
by
bmeacham
10 hours, 54 minutes ago -
*Some settings are managed by your organization
by
rlowe44
11 minutes ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
9 hours, 48 minutes ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
1 day, 5 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
1 day, 14 hours ago -
AI slop
by
Susan Bradley
4 hours, 35 minutes ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
1 day, 15 hours ago -
Two blank icons
by
CR2
3 hours, 31 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
2 days ago -
End of 10
by
Alex5723
2 days, 3 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
1 day, 1 hour ago -
test post
by
gtd12345
2 days, 9 hours ago -
Privacy and the Real ID
by
Susan Bradley
1 day, 23 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
1 hour, 50 minutes ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
2 days, 13 hours ago -
Upgrading from Win 10
by
WSjcgc50
1 day, 1 hour ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
1 day, 4 hours ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
3 days, 5 hours ago -
The story of Windows Longhorn
by
Cybertooth
2 days, 17 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
3 days, 7 hours ago -
Are manuals extinct?
by
Susan Bradley
7 hours, 43 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
3 days, 16 hours ago -
Network Issue
by
Casey H
3 days, 3 hours ago -
Fedora Linux is now an official WSL distro
by
Alex5723
4 days, 4 hours ago -
May 2025 Office non-Security updates
by
PKCano
4 days, 4 hours ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
4 days, 6 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.