My small white, with vba to modify folder word file called word first line, the card to the Name WORD_name As WORD_title this sentence, what is prompt, any invalid procedure call or parameters, beg god to look at, what happened,,,
Option Explicit Sub open folder file and rename the title name them one by one ()
Dim WORD_title As String, EXCEL_name As String, EXCEL_name2 As String, WORD_name As String, the Count As Integer 'definition of word class Dim Wordapp As Word. Application Dim WordD As Word. The Document 'definition of Word class 'Wordapp. ScreenUpdating=False' screen refresh With the Application. The FileDialog (msoFileDialogFilePicker) 'Open the file dialog . AllowMultiSelect=True The Show For the Count=1 To. SelectedItems. Count WORD_name=Dir. (SelectedItems (Count))
The Set Wordapp=New Word. Application Visible Wordapp. Visible=True ' The Set WordD=Wordapp. Documents. The Open (. SelectedItems (Count) 'Open the document WORD_title=ActiveDocument. Paragraphs (1). The Range, the Text WordD. Save WordD. Close Close the document ' The Set WordD=Nothing WORD_title=WORD_title & amp; Mid (WORD_name, Application. The Find (". ", WORD_name)) 'excessive, the name and extension of
'Wordapp. Quit out of Word object the Name WORD_name As WORD_title Next the Count
End With
End Sub
CodePudding user response:
WORD_title=ActiveDocument. Paragraphs (1). The Range, the Text
You see if WORD_title value "carriage returns" or "line" end?