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

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

Post by Alan-Lee P » Wed, 15 Dec 2004 18:59:12


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
 
 
 

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

Post by Cindy M -W » Thu, 16 Dec 2004 21:58:29

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?


Cindy Meister
INTER-Solutions, Switzerland
http://www.yqcomputer.com/ (last update Jun 8 2004)
http://www.yqcomputer.com/

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

 
 
 

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

Post by Alan-Lee P » Fri, 17 Dec 2004 19:17:09

i 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-" < XXXX@XXXXX.COM >
Newsgroups: microsoft.public.office.developer.automation
Sent: Wednesday, December 15, 2004 1:58 PM
Subject: Re: HELP !!! OLE Word .... SaveFile !?!?!


have
VOptional,
VOptional,
VOptional,
VOptional,
"Cindy M -WordMVP-" < XXXX@XXXXX.COM > schrieb im Newsbeitrag
news:VA.0000a4a1.00058341@speedy...
have
VOptional,
VOptional,
VOptional,
VOptional,


 
 
 

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

Post by Viatchesla » Sat, 18 Dec 2004 04:10:36

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

Best regards,
Viatcheslav V. Vassiliev

"Alan-Lee Perkins" < XXXX@XXXXX.COM > news: XXXX@XXXXX.COM ..>
> Hi Cindy>
> thanks for you response..>
> When i try to do this with word-xp ( Visual C++ 6.0 ) i get the erro>
> 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-Le>
> ----- Original Message ---->
> From: "Cindy M -WordMVP<" > Newsgroups: microsoft.public.office.developer.automatio>
> Sent: Wednesday, December 15, 2004 1:58 P>
> Subject: Re: HELP !!! OLE Word .... SaveFile !?!?>
VB> >> > automation. Word 95 required WordBasic, a completely different language> >> > >> > You should also provide information on exactly what kind of problem yo>
> hav> >> > 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 Meiste> >> > INTER-Solutions, Switzerlan> >> > http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004> >> > http://www.word.mvps.or> >> > >> > This reply is posted in the Newsgroup; please post any follow question
o> >> > reply in the newsgroup and not by e-mail :-> >> >
> "Cindy M -WordMVP<" schrieb im Newsbeitra>
> news:VA.0000a4a1.00058341@speedy..> >> > Hi Alan-Lee> >> > >> > What's "Word59"? do you mean Word 95? You can't automate Word95 using
VB> >> > automation. Word 95 required WordBasic, a completely different language> >> > >> > You should also provide information on exactly what kind of problem yo>
> hav> >> > 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> >>>> > >>&g