Public Sub HMSSave(Optional informUser As Boolean = True)
'variables added for brit
Dim wpathdoc As String
Dim wpathtx As String
Dim docToClose As String
Dim docToClose As String
Dim foundstring As Long
Dim britpathtxt As String
Dim tempvar As String
'end of variables
'save a version for brit teleradiology
If ActiveDocument.Name Like "*_temp.doc" Then
System.Cursor = wdCursorWait
wpathdoc = ActiveDocument.Variables("wpathdocvar").Value
wpathtxt = ActiveDocument.Variables("wpathtxtvar").Value
foundstring = InStr(1, wpathtxt, "\")
tempvar = wpathtxt
While foundstring <> 0
tempvar = Mid(tempvar, foundstring + 1)
foundstring = InStr(foundstring, tempvar, "\")
Wend
'end of brit code
ActiveDocument.save 'saves the doc as "app_path + \temp.doc"
On Error Resume Next
Kill wpathdoc
Kill wpathtxt
' New for brit
Kill britpathtxt
' End
On Error GoTo 0
' store the name of the current document
docToOpen = ActiveDocument.FullName
' createtextfile (APP_PATH + "\temp.txt")
ActiveDocument.SaveAs FileName:=wpathtxt, fileformat:=wdFormatDOSTextLineBreaks
'Save a txt copy for brit teleradiology
britpathtxt = "I:\brit\" & ActiveDocument.Name
ActiveDocument.SaveAs fileName:=britpathtxt, fileformat:=wdFormatDOSTextLineBreaks
'end
'get the current name of the doc
docToClose = ActiveDocument.Name
're-open temp.doc for more editing
Documents.Open docToOpen
'Close the other doc
Document(docToClose).Close
If informUser = true then
MsgBox “Document saved.”, vbOKOnly + vbInformation, “HMS Trans”
End if
=============================================================This is the new code that they have in the Macro
Public Sub HMSSave(Optional informUser As Boolean = True)
shouldBeMoved = True
'Make sure to update all built in document properties.
ActiveDocument.ComputeStatistics wdStatisticCharacters
ActiveDocument.ComputeStatistics wdStatisticCharactersWithSpaces
ActiveDocument.ComputeStatistics wdStatisticLines
ActiveDocument.ComputeStatistics wdStatisticPages
ActiveDocument.ComputeStatistics wdStatisticWords
ActiveDocument.save
If informUser = True Then
If getType() = TYPE_DOCUMENT Then
VBA.MsgBox "Transcription document saved.", vbOKOnly + vbInformation, "HMS Transcription"
Else
VBA.MsgBox "Transcription template saved.", vbOKOnly + vbInformation, "HMS Transcription"
End If
End If
End Sub