I'm Lost...

I am trying to create a file and then have the file come up in Word.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <Windows.h>
#include <stdio.h>
#include <string>
#include <fstream>
#include <iostream>
using namespace std;

int main()
{
 string filename;                       
getline(cin, filename, '\n');         
  ofstream ofile("C:\\FILE.DOC");
  if (ofile) ofile << filename<< endl;    
ofile.close(); 


ShellExecute()
NULL,
_T("open"),                              
_T("FILE.DOC")               
NULL, 
NULL, 
		SW_SHOW);



}
Try to use this commands:
1
2
3
4
5
int main()
{
FILE*f1=fopen("c:\\FILE.doc",w+);

}

It should work...
Topic archived. No new replies allowed.