S
singeredel
Two documents are created with the variable names "SaveNotesFile" and
"SaveFileName". SaveNotesFile is active and showing on the screen. The next
code is attempting to activate SaveFileName, as follows:
Documents(SaveFileName).Activate
When hovering over this code while stepping through the code, the correct
file name is showing in the SaveFileName variable, but the screen does not
actually switch the view to this file so that more action can be taken on
this file.
What am I doing wrong here? How do I get SaveFileName to show as active on
the screen? (I am NOT a programmer, so if you can answer this in layman's
terms, I would really appreciate it!)
Below is a portion of the code from the programming that pertains to when
this code seems to bomb out. It does not seem to do anything after the
"ActiveDocument.SaveAs (SaveNotesFile)" line right before the EndProcedure:
MakeNotesFile:
Dim TestFile1 As String
TestFile1 = Dir(SaveNotesFile)
If Len(TestFile1) = 0 Then
Documents.Add Template:="Normal", NewTemplate:=False
Selection.Style = ActiveDocument.Styles("Normal2")
With Selection.Font
.AllCaps = True
.Bold = True
End With
Selection.TypeText Text:="NOTES:"
Selection.TypeParagraph
Selection.TypeText Text:=Doctor + " - " + DictationDate2
Selection.TypeParagraph
Selection.TypeParagraph
With Selection.Font
.Bold = False
.AllCaps = False
End With
Selection.TypeText "None."
ActiveDocument.SaveAs (SaveNotesFile),
FileFormat:=wdFormatDocument
Else: GoTo EndProcedure
End If
EndProcedure:
Documents(SaveFileName).Activate
With ActiveDocument.ActiveWindow
ActiveWindow.View.Type = wdNormalView
ActiveWindow.ActivePane.View.Zoom.Percentage = 130
.DisplayRulers = True
End With
"SaveFileName". SaveNotesFile is active and showing on the screen. The next
code is attempting to activate SaveFileName, as follows:
Documents(SaveFileName).Activate
When hovering over this code while stepping through the code, the correct
file name is showing in the SaveFileName variable, but the screen does not
actually switch the view to this file so that more action can be taken on
this file.
What am I doing wrong here? How do I get SaveFileName to show as active on
the screen? (I am NOT a programmer, so if you can answer this in layman's
terms, I would really appreciate it!)
Below is a portion of the code from the programming that pertains to when
this code seems to bomb out. It does not seem to do anything after the
"ActiveDocument.SaveAs (SaveNotesFile)" line right before the EndProcedure:
MakeNotesFile:
Dim TestFile1 As String
TestFile1 = Dir(SaveNotesFile)
If Len(TestFile1) = 0 Then
Documents.Add Template:="Normal", NewTemplate:=False
Selection.Style = ActiveDocument.Styles("Normal2")
With Selection.Font
.AllCaps = True
.Bold = True
End With
Selection.TypeText Text:="NOTES:"
Selection.TypeParagraph
Selection.TypeText Text:=Doctor + " - " + DictationDate2
Selection.TypeParagraph
Selection.TypeParagraph
With Selection.Font
.Bold = False
.AllCaps = False
End With
Selection.TypeText "None."
ActiveDocument.SaveAs (SaveNotesFile),
FileFormat:=wdFormatDocument
Else: GoTo EndProcedure
End If
EndProcedure:
Documents(SaveFileName).Activate
With ActiveDocument.ActiveWindow
ActiveWindow.View.Type = wdNormalView
ActiveWindow.ActivePane.View.Zoom.Percentage = 130
.DisplayRulers = True
End With