There are no protected files or folders and the filename looks good.
I got this code because I want to save a mail merge document to to separate
files.
Gary Mayor had some nifty code for doing this, but it always stops at the
.SaveAs command.
Sample code below:
Dim mask As String
Selection.EndKey Unit:=wdStory
Letters = Selection.Information(wdActiveEndSectionNumber)
mask = "ddMMyy"
Selection.HomeKey Unit:=wdStory
Counter = 1
While Counter < Letters
DocName = "D:\My Documents\Temp\Workgroup\" & Format(Date, mask) _
& " " & LTrim$(Str$(Counter)) & ".doc"
ActiveDocument.Sections.First.Range.Cut
Documents.Add ("ranksheet.dot")
With Selection
.Paste
.EndKey Unit:=wdStory
.MoveLeft Unit:=wdCharacter, Count:=1
.Delete Unit:=wdCharacter, Count:=1
End With
//the problem is in this line
ActiveDocument.SaveAs FileName:=DocName, FileFormat:=wdFormatDocument
ActiveWindow.Close
Counter = Counter + 1
Wend

Signature
Gerry Pyle
Columbus, Ohio
> In addition:
> How's is this filename built up?
[quoted text clipped - 31 lines]
> >> Gerry Pyle
> >> Columbus, Ohio
Perry - 12 Apr 2007 23:14 GMT
Try to change this
> mask = "ddMMyy"
into
mask = "ddMMyy hhmmss"
--
Krgrds,
Perry
System:
Vista/Office Ultimate
VS2005/VSTO2005 SE
> There are no protected files or folders and the filename looks good.
>
[quoted text clipped - 69 lines]
>> >> Gerry Pyle
>> >> Columbus, Ohio