Public
Sub
CreateTestFromSolution()
Dim
pDocInfo
As
cDocumentInfo
Set
pDocInfo =
New
cDocumentInfo
pDocInfo.FromFileName ActiveDocument.name
If
pDocInfo.TypeEnum <> itsCwTypeTestSolution
Then
MsgBox ActiveDocument.name &
" ist keine Test-Lösung (TES)"
, vbCritical + vbOKOnly,
"Courseware Prüfer - "
& ActiveDocument.name
Exit
Sub
End
If
Dim
na
As
String
, nna
As
String
, ndoc
As
Document, oDoc
As
Document
Set
oDoc = ActiveDocument
na = ActiveDocument.FullName
nna = Replace(na,
"TES"
,
"TE"
)
Set
ndoc = Application.Documents.Add(ActiveDocument.FullName)
ndoc.SaveAs2 FileName:=nna, FileFormat:=wdFormatXMLDocument, _
LockComments:=
False
, Password:=
""
, _
AddToRecentFiles:=
True
, WritePassword:=
""
, ReadOnlyRecommended:=
False
, _
EmbedTrueTypeFonts:=
False
, SaveNativePictureFormat:=
False
, SaveFormsData:=
False
, _
SaveAsAOCELetter:=
False
, CompatibilityMode:=15
oDoc.Close SaveChanges:=wdDoNotSaveChanges
ndoc.Activate
<em><strong> </strong></em>