View Single Post
 
Old 04-13-2017, 01:41 AM
mihnea96 mihnea96 is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Apr 2017
Posts: 26
mihnea96 is on a distinguished road
Default

In this situation I have 933 Q&As and it generates ~933 documents (but I have other documents with more than 10.000). My question was if there is any VBA code for extracting text from the document and use it as a name for that document, as I cannot install any macros. I mean, what should i write instead of this:

'build a new sequentially-numbered file name based on the original multi-paged file name and path
strNewFileName = Replace(docMultiple.FullName, ".doc", "_" & Right$("000" & iCurrentPage, 4) & ".doc")
ActiveDocument.SaveAs2 FileName:= _
"TEXT FROM INSIDE" _
, FileFormat:=wdFormatXMLDocument, LockComments:=False, Password:="", _
AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _
:=False, SaveAsAOCELetter:=False, CompatibilityMode:=14 'save the new single-paged document


Thank you very much!
Reply With Quote