I work with three documents open at one time. The first document is a patient log, the second document is used to cut and paste the patient reports with page breaks to have one long continous document for E-mailing later, and the third document is where I type each individual report, saving and then exiting, etc. I have created a macro that copies and pastes the current typed report to document two, places a page break, and then switches to document one to input the patient variable information onto the patient log sheet. This macro runs fine for a while and then I get an error message after about ten uses. I believe that the problem is because I have used ActiveWindow.Previous.Activate and ActiveWindow.Next.Activate codes, as the macro seems to get confused after a while. Is there a way to define exactly where the macro should take me without using these codes? I was thinking that maybe if I created documents named log and copy that it could be written into the code telling the macro specifically where to go and perform the essential functions?
I would like to create a macro that automatically saves each report with the defined patient variable information; however, I have no clue as to what the code would be for this. I tried using ActiveDocument.SaveAs FileName:="vPatient", but all this did was actually save with vPatient instead of the stored variable information.
Thank you for all of your help.