Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MS Word File - SavingAS
Message
De
03/08/2001 09:55:57
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
02/08/2001 15:58:48
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00539064
Message ID:
00539358
Vues:
13
This message has been marked as the solution to the initial question of the thread.
>Hello All,
>
>One of the few things I can't find in Tamar's and Della's book is how to:
>
>.ActiveDocument.SaveAs "c:\myDocu~1\MyLabels.doc", ReadOnlyRecommended:=False
>
>I can save the .dot as a .doc OK but can't clear the "ReadOnly Recommended".
>
>There is probably a numeric parm like (0) to "wdsavewithoutchanges" but I can't find reference to it anywhere - even in the VBA object browser. I thought it might be: "ReadOnlyRecommended=False" but that didn't work. Anyone worked with and resolved this. TIA.
>
>Regards,
>
>Paige
>
>
>With oWord
> .Documents.Open "c:\My Documents\MyLabels.dot"
> .ActiveDocument.SaveAs "c:\myDocu~1\MyLabels.doc", ReadOnlyRecommended:=False
> .ActiveDocument.Close(0)
> .Documents.Open ("c:\myDocu~1\MyLabels.doc")
>EndWith

wdDoNotSaveChanges is do not save constant but there I think you want save changes as WordDocument.
Full syntax is :
expression.SaveAs(FileName, FileFormat, LockComments, Password, AddToRecentFiles, WritePassword, ReadOnlyRecommended, EmbedTrueTypeFonts, SaveNativePictureFormat, SaveFormsData, SaveAsAOCELetter)

From VFP you can't use named parameters as in VB (and as macro recorder does) but positional ones. Pratameter positions are shown in syntax. You can omit any optional parameter. So your VFP version becomes :
#define wdWordDocument 0
#define wdFormatDocument 0
#define wdSaveChanges -1
#define wdDoNotSaveChanges 0
.ActiveDocument.SaveAs("c:\myDocu~1\MyLabels.doc", wdFormatDocument,,,,, .F.)
.ActiveDocument.Close(wdSaveChanges,wdWordDocument)
Notice how optional parameters up to ReadOnlyRecommended and after that are omitted (defaults satisfy).
To find any constant in office apps (when you don;t have an .h file), open any office application, Alt+F11, F2 (object browser), write constant name in combo next to binoculars and press enter.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform