Copy content to new Word document
Im trying to put together a macro that copies the content of the active document as a new document. The name of the new document is liable to change and therefore gets the name from a text file.
Im having problems creating the new document in which to copy to as per my code so far;
Dim MyFileName As String 'This will be the name of the new document
Open "C:\Sol\test.txt" For Input As #1
Line Input #1, MyFileName
While Not EOF(1)
Loop While EOF(1) = False
Sub Copy_Content(MyFileName As String)
Dim targDoc As Word.Document
'MsgBox MyFileName 'Used to test the variable was passed
Set targDoc = Documents.Add("c:\sol\" & MyFileName & ".doc") 'Here Im trying to create a new document to paste to
I would be grateful for any advice please.