Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-02-2020, 02:47 PM
Guessed's Avatar
Guessed Guessed is offline autofldupdt macro - Modifying to keep part of file name Windows 10 autofldupdt macro - Modifying to keep part of file name Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Your code is removing the file extension from the name but you don't replace it with xlsx. I would set the name by



' Set the new filename
NewFile = Replace(ActiveDocument.Name, ".docx", ".xlsx")
NewFile = Replace(NewFile, "Final Report", "Tables")

I assume your code includes looping through all story ranges but you haven't shown us that outer loop. If that is the case then it will hit all footers as well.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #2  
Old 12-02-2020, 03:23 PM
dinofanatic dinofanatic is offline autofldupdt macro - Modifying to keep part of file name Windows 10 autofldupdt macro - Modifying to keep part of file name Office 2019
Novice
autofldupdt macro - Modifying to keep part of file name
 
Join Date: Nov 2020
Posts: 5
dinofanatic is on a distinguished road
Default

Thanks for the extension suggestion. I've made the appropriate edit, however I'm still getting that error at the ".SourceFullName = Replace(.SourceFullName, OldPath, NewPath)" line. I've attached the edited code, unless posting the whole text here would be easier to read?
Attached Files
File Type: zip FieldUpdate.zip (1.9 KB, 17 views)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Corrupted Footnotes After Modifying File on Macbook! MusculaR_MinD Word 3 12-12-2019 06:09 PM
autofldupdt macro - Modifying to keep part of file name macro to change part of the name of an existing Word file justinmo Word VBA 2 09-11-2018 06:08 PM
Modifying RTF File in MS Word 2007 Nickster Word VBA 2 12-02-2015 11:33 PM
autofldupdt macro - Modifying to keep part of file name Copying a part of a docx file as a separate file officeboy09 Word 6 09-26-2014 05:15 PM
autofldupdt macro - Modifying to keep part of file name modifying a PST file ctspwc Outlook 5 11-17-2010 09:29 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:49 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft