HELP !!! OLE Word .... SaveFile !?!?!

A

Alan-Lee Perkins

I try to Save a new file with OLE ( Visual C++ 6.0)

but i have problems with the parameters :

CString sTmp;

COleVariant VOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);

sTmp = "C:\\tmp\\document1.doc";

m_WordDocument.SaveAs ( sTmp, VOptional, VOptional, VOptional, VOptional,
VOptional, VOptional, VOptional,
VOptional, VOptional, VOptional,
VOptional, VOptional, VOptional,
VOptional, VOptional );

whats wrong with my parameters ?

maybe you can send me a example for it... ( Word59 / 2k and XP )

Alan-Lee
 
C

Cindy M -WordMVP-

Hi Alan-Lee,

What's "Word59"? do you mean Word 95? You can't automate Word95 using VBA
automation. Word 95 required WordBasic, a completely different language.

You should also provide information on exactly what kind of problem you have
with the parameters. Error messages?
I try to Save a new file with OLE ( Visual C++ 6.0)

but i have problems with the parameters :

CString sTmp;

COleVariant VOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);

sTmp = "C:\\tmp\\document1.doc";

m_WordDocument.SaveAs ( sTmp, VOptional, VOptional, VOptional, VOptional,
VOptional, VOptional, VOptional,
VOptional, VOptional, VOptional,
VOptional, VOptional, VOptional,
VOptional, VOptional );

whats wrong with my parameters ?

maybe you can send me a example for it... ( Word59 / 2k and XP )

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
A

Alan-Lee Perkins

Hi Cindy,

thanks for you response...

When i try to do this with word-xp ( Visual C++ 6.0 ) i get the error
message : "internal application error" .. thats all.

COleVariant covTrue((short)TRUE), covFalse((short)FALSE),
covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
CString sTmp;

sTmp = "C:\\temp\\testapp1.doc";

m_WordDocument.SaveAs(sTmp, covOptional, covOptional,
covOptional, covOptional, covOptional, covOptional,
covOptional,
covOptional, covOptional, covOptional, covOptional,
covOptional,
covOptional, covOptional, covOptional);

whats the problem ? OLE is new for me sorry ... ;-)

Alan-Lee








----- Original Message -----
From: "Cindy M -WordMVP-" <[email protected]>
Newsgroups: microsoft.public.office.developer.automation
Sent: Wednesday, December 15, 2004 1:58 PM
Subject: Re: HELP !!! OLE Word .... SaveFile !?!?!
 
V

Viatcheslav V. Vassiliev

OLE always uses BSTR, never ANSI. Try use COleVariant("c:\\...").

Best regards,
Viatcheslav V. Vassiliev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top