Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Fri, 25 Nov 2005 05:53:02 -0800,    group: microsoft.public.word.vba.customization        back       


Changing RTF file to Word Document   
I save an Access report as a RTF document and would like from within Access 
to convert it to a Word document.  I set up the code in Access as follows but 
it does not save the file.  Can anyone help ?

  strF1Month = "FileName"
 
  Set docSource = wdApp.Documents.Open(strF1Month)
  docSource.SaveAs FileName:=strF1Month, FileFormat:=wdFormatDocument
date: Fri, 25 Nov 2005 05:53:02 -0800   author:   rmcompute

Re: Changing RTF file to Word Document   
Various possible problems

1. The filename will probably actually be FileName.rtf rather than just 
FileName

2. The filename that you save the document in Word format should be 
FileName.doc. So you may need to do some processing of the strF1Month string 
to get the extension right.

3. I would recommend you include the full pathname in strF1Month rather than 
just the filename. That way you are not dependent on Word's current folder 
happening to be where the file is located.

4. If you have not set a reference to the Word object model in Tools 
References, and have instead set a late-bound reference to wdApp using 
GetObject or CreateObject, then your code will not know the value of the 
constant wdFormatDocument. Put its value in instead, which is 0.

-- 
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org


"rmcompute"  wrote in message 
news:990115D2-3AB8-4C24-9E1A-901D69AE32F3@microsoft.com...
>I save an Access report as a RTF document and would like from within Access
> to convert it to a Word document.  I set up the code in Access as follows 
> but
> it does not save the file.  Can anyone help ?
>
>  strF1Month = "FileName"
>
>  Set docSource = wdApp.Documents.Open(strF1Month)
>  docSource.SaveAs FileName:=strF1Month, FileFormat:=wdFormatDocument
>
date: Fri, 25 Nov 2005 16:04:39 -0000   author:   Jonathan West

Re: Changing RTF file to Word Document   
Thank you. 

"Jonathan West" wrote:

> Various possible problems
> 
> 1. The filename will probably actually be FileName.rtf rather than just 
> FileName
> 
> 2. The filename that you save the document in Word format should be 
> FileName.doc. So you may need to do some processing of the strF1Month string 
> to get the extension right.
> 
> 3. I would recommend you include the full pathname in strF1Month rather than 
> just the filename. That way you are not dependent on Word's current folder 
> happening to be where the file is located.
> 
> 4. If you have not set a reference to the Word object model in Tools 
> References, and have instead set a late-bound reference to wdApp using 
> GetObject or CreateObject, then your code will not know the value of the 
> constant wdFormatDocument. Put its value in instead, which is 0.
> 
> -- 
> Regards
> Jonathan West - Word MVP
> www.intelligentdocuments.co.uk
> Please reply to the newsgroup
> Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
> 
> 
> "rmcompute"  wrote in message 
> news:990115D2-3AB8-4C24-9E1A-901D69AE32F3@microsoft.com...
> >I save an Access report as a RTF document and would like from within Access
> > to convert it to a Word document.  I set up the code in Access as follows 
> > but
> > it does not save the file.  Can anyone help ?
> >
> >  strF1Month = "FileName"
> >
> >  Set docSource = wdApp.Documents.Open(strF1Month)
> >  docSource.SaveAs FileName:=strF1Month, FileFormat:=wdFormatDocument
> > 
> 
>
date: Fri, 25 Nov 2005 17:56:01 -0800   author:   rmcompute

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us