Solved

open word 2000 file and write in it.

Posted on 2002-05-30
7
242 Views
Last Modified: 2013-11-20
can anyone tell me the procedure to opening a new word 2000 file and write in it programatically.
i am using VC++ to do so.

ult
0
Comment
Question by:Ultpak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 7044228
Please search in MSDN with "HOWTO: Use Automation to Run a Word Macro with Arguments"

(Don't forget to put quotes both sides)

You will get similar operations using word from that article


GOOD LUCK
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 7044230
Another Title is

"Automating Microsoft Office 97 and Microsoft Office 2000"

GOOD LUCK
0
 
LVL 3

Expert Comment

by:Crius
ID: 7045142
I don't believe he is wanting to automate word 2000, I think he wants to just read/write to a Word 2000 file.

Is this a question regarding the format of a Word 2000 file?
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 22

Accepted Solution

by:
ambience earned 200 total points
ID: 7046232
Undertanding word file format is really an overkill when you can use Word to do the work for you, why is there automation afterall.

Here is a simple way to use Word
Import word type library, and add atleast the classes used in following code, _Application, Documents, _Document, Range etc.

COleVariant var;
_Application application;

var.vt = VT_ERROR;
var.scode = DISP_E_PARAMNOTFOUND;

application.CreateDispatch(_T("word.application"));
application.SetVisible(Visible);

Documents documents = application.GetDocuments();
_Document document = documents.Add(var,var);

Range range = document.Range(var,var);
range.InsertAfter(_T("hello"));void CMyReport::Close()

COleVariant savechanges = 1L;
application.Quit(savechanges,var,var);



0
 
LVL 3

Expert Comment

by:Crius
ID: 7047100
True enough, automating Word is one of the easiest ways to read/write a Word file, but he didn't say he has Word 2000 anywhere. He may not have Word 2000. Since he is writing a program, he may distribute the program to people who do not have Word 2000.

That is my concern..

So, if you/your userbase have Word 2000, the best way to go is written above by others. If you do not, it will get more complex. Very complex in fact.

Here is an explanation of the Word 97 file format:
http://www.redbrick.dcu.ie/~bob/Tech/wword8.html

It that link doesn't scare you, and you really want to pursue opening and reading/writing Word files with your own program, this link:
http://www.wvware.com/wvInfo.html
contains much information on the Microsoft Office formats, including Word 2000, as well as freeware libraries/products to aid in your task.
0
 

Author Comment

by:Ultpak
ID: 7048387
hi ambience

thanx it worked.
now i can write in word file.\
can u plese tell me, if i want to write at a specific position , i mean at the line 20 etc
what to do to do this.
thankx again.
ult
0
 

Author Comment

by:Ultpak
ID: 7050840
thankx for helping me
0

Featured Post

Percona Monitoring and Management and Grafana

Proactive monitoring is vital to a highly-available environment. We have a quick start guide on Experts Exchange for Grafana users.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question