D
Domestos
Hi all,
I assume what i need to do is very simple, but i have not got a clue how to
do it. I have tried various things with no luck...
What I need to do is this...
I have a 120 page document, I need to copy each page in turn and paste it
into a new document. This I have managed to do...
I then need to save that new document with a dynamic filename. The filename
will be taken from the first word of the document. I have tried the
following but keep getting an error (expected function or variable)
Please help, and many thanks in advance...
eg.
Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend ' selects
first word in document
Selection.Copy ' copies selection
myDocname = Selection.Paste ' trying to paste my selection into a
variable
myDocname = myDocname & ".doc" ' appends '.doc' to variable
ActiveDocument.SaveAs FileName:=myDocname, FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
ActiveWindow.Close
Domestos
I assume what i need to do is very simple, but i have not got a clue how to
do it. I have tried various things with no luck...
What I need to do is this...
I have a 120 page document, I need to copy each page in turn and paste it
into a new document. This I have managed to do...
I then need to save that new document with a dynamic filename. The filename
will be taken from the first word of the document. I have tried the
following but keep getting an error (expected function or variable)
Please help, and many thanks in advance...
eg.
Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend ' selects
first word in document
Selection.Copy ' copies selection
myDocname = Selection.Paste ' trying to paste my selection into a
variable
myDocname = myDocname & ".doc" ' appends '.doc' to variable
ActiveDocument.SaveAs FileName:=myDocname, FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
ActiveWindow.Close
Domestos