Step by step. Examine the variables. See what it does and why it does it.
That's routine for programmers if they can't find the cause by reading the source. Eventually, they find it.
Kees
This macro use to work but now it doesn?t. It should (I think) save this word document as a text file onto our network. Nothing goes out to that folder anymore. I tried changing the path to the computers c: but that did not work either. Any ideas???????
Public Sub HMSSave(Optional informUser As Boolean = True)
Dim wpathdoc As String
Dim wpathtxt As String
Dim docToClose As String
Dim docToOpen As String
'variables added for Brit
Dim FoundString As Long
Dim britpathtxt As String
Dim tempvar As String
'End of new variables ksj
If ActiveDocument.Name Like "*_temp.doc" Then
System.Cursor = wdCursorWait
wpathdoc = ActiveDocument.Variables("wpathdocvar").Value
wpathtxt = ActiveDocument.Variables("wpathtxtvar").Value
'save a version for Brit
FoundString = InStr(1, wpathtxt, "\")
tempvar = wpathtxt
While FoundString <> 0
tempvar = Mid(tempvar, FoundString + 1)
FoundString = InStr(FoundString, tempvar, "\")
Wend
'end of Brit code snipet ksj
ActiveDocument.save 'saves the doc as "APP_PATH + \temp.doc"
On Error Resume Next
Kill wpathdoc
Kill wpathtxt
'new for Brit
Kill britpathtxt
'end ksj
On Error GoTo 0
'store the name of the current document
docToOpen = ActiveDocument.FullName
'createTextFile (APP_PATH + "\temp.txt")
ActiveDocument.SaveAs fileName:=wpathdoc
'FileCopy APP_PATH + "\temp.txt", wpathtxt
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 ksj
'get the current name of the doc
docToClose = ActiveDocument.Name
're-open temp.doc for more editing
Documents.Open docToOpen
'close the other doc
Documents(docToClose).Close
If informUser = True Then
MsgBox "Medical Records Transcription document saved.", vbOKOnly + vbInformation, "HMS Transcription"
End If
System.Cursor = wdCursorNormal
Else
'simply save the document with the same name and location
ActiveDocument.save
End If
End Sub

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic