hello
i was wondering when the final ouput to my program gets sent to the word document, is it possible to change the font that gets sent to that particular word document with the program and not just manualy changing it on word?
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main()
{
ofstream outputFile;
outputFile.open("C:\\Users\\Owner\\Desktop\\DoctorsOutPut.doc");
string Pname, CEmployer, AWUTDspecification, AMPM, RLhand,
AllergiesSpecification, HPI, SSN, TDate, DOB,DOI, IBP, MOFI,Complaints;
int age, n, y;
char AWUTD, Allergies;
n=0;
y=0;
AWUTD=0;
cout<<"Patients Name:"<<endl;
getline (cin, Pname);
cin.ignore(1000,'\n');
cout<<'\n';
cout<<"What is todays date?"<<endl;
getline (cin, TDate);
cout<<'\n';
cout<<"Age:"<<endl;
cin>>age;
cin.ignore(1000,'\n');
cout<<'\n';
cout<<"When is the patients birthday?"<<endl;
getline (cin, DOB);
cout<<'\n';
cout<<"Patients Social Security Number: "<<endl;
getline (cin, SSN);
cout<<'\n';
cout<<"What was the date of the injury?"<<endl;
getline (cin, DOI);
cout<<"Was appointment AM or PM"<<endl;
getline (cin, AMPM);
cout<<'\n';
cout<<"Employer:"<<endl;
getline (cin, CEmployer);
cout<<'\n';
cout<<"Right or Left Handed?"<<endl;
getline (cin, RLhand);
cout<<'\n';
cout<<"Does the patient have any allergies? Y/N"<<endl;
cin>>Allergies;
cin.ignore(1000,'\n');
cout<<'\n';
if(Allergies=='y'||Allergies=='Y')
{
cout<<"What is patient allergic to:"<<endl;
getline (cin, AllergiesSpecification);
cin.ignore(1000,'\n');
}
else if (Allergies=='n'||Allergies=='N')
{
cout<<endl;
}
cout<<"Patients HPI:"<<endl;
getline (cin, HPI);
cout<<'\n';
cin.ignore(1000,'\n');
cout<<"What are the injured body parts?"<<endl;
getline (cin, IBP);
cout<<"What is the mechanism of injury?"<<endl;
getline (cin, MOFI);
cout<<"Any complaints?"<<endl;
getline (cin, Complaints);
cin.ignore(1000, '\n');
cout<<"Any work up to date? Y/N"<<endl;
cin>>AWUTD;
if(AWUTD=='y'||AWUTD=='Y')
{
cout<<"Please Specify:"<<endl;
getline (cin, AWUTDspecification);
}
else if (AWUTD=='n'||AWUTD=='N')
{
cout<<endl;
}
cout<<'\n';
cout<<'\n';
cout<<'\n';
cout<<"Name: "<<Pname<<"\t\t\t\t"<<"Date: "<<TDate<<endl;
outputFile<<"Name: "<<Pname<<"\t\t\t\t"<<"Date:"<<TDate<<endl;
cout<<"Age: "<<age<<"\t\t"<<"D.O.B: "<<DOB<<"\t\t"<<"SSN: "<<SSN<<endl;
outputFile<<"Age: "<<age<<"\t\t\t"<<"D.O.B:"<<DOB<<"\t\t\t"<<"SSN: "<<SSN<<endl;
cout<<"DOI: "<<DOI<<endl;
outputFile<<"DOI: "<<DOI<<endl;
cout<<"Appointment: "<<AMPM<<endl;
outputFile<<"Appointment: "<<AMPM<<endl;
cout<<"Employer: "<<CEmployer<<endl;
outputFile<<"Employer: "<<CEmployer<<endl;
cout<<"Right or Left handed: "<<RLhand<<"handed"<<endl;
outputFile<<"Right or Left handed: "<< RLhand<<"handed"<<endl;
cout<<"Allergies: "<<Allergies<<endl;
if
(Allergies=='y' || Allergies=='Y')
{
cout<<"Patient is allergic to:"<<AllergiesSpecification<<endl;
}
else if (Allergies =='n' || Allergies=='N')
{
cout<<endl;
}
cout<<"HPI: "<<HPI<<endl;
outputFile<<"HPI: "<<HPI<<endl;
cout<<"Injured body parts: "<<IBP<<endl;
outputFile<<"Injured body parts: "<<IBP<<endl;
cout<<"Mechanism of injury:"<<MOFI<<endl;
outputFile<<"Mechanism of injury:"<<MOFI<<endl;
cout<<"Complaints: "<<Complaints<<endl;
outputFile<<"Complaints: "<<Complaints<<endl;
cout<<"Any work up to date?"<<AWUTD<<endl;//if statement to show correct output
if
(AWUTD=='y' || AWUTD=='Y')
{
cout<<"Work up to date includes:"<<AWUTDspecification<<endl;
}
else if (AWUTD =='n' || AWUTD=='N')
{
cout<<endl;
}
outputFile.close();
};