Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

OLE - Save method

Former Member
0 Likes
859

hi,

i want to save a word file into my desktop, I am able to open a word document, feed data using OLE and when I am trying to save using the below code


  CALL METHOD OF wordobj 'SaveAs' EXPORTING
    #1 = 'c:\11\information1.doc'
    #2 = '0'
    #3 = 'False'
    #4 = ''
    #5 = 'True'
    #6 = ''
    #7 = 'False'
    #8 = 'False'
    #9 = 'False'
    #10 = 'False'
    #11 = 'False'.

The corresponding VB code is as below


Sub saveonly()
'
' saveonly Macro
' Macro recorded 3/12/2009 by Krishna
'
    ChangeFileOpenDirectory "C:\Documents and Settings\krishna\Desktop\"
    ActiveDocument.SaveAs FileName:="112111.doc", FileFormat:=wdFormatDocument _
        , LockComments:=False, Password:="", AddToRecentFiles:=True, _
        WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
         SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
        False
End Sub

Please let me know what is wrong in this code.. I have searched the SDN forum, but I could not find a solution ..

Thanks

Krishnan

2 REPLIES 2
Read only

Former Member
0 Likes
611

Hi Krishnan,

You must use 0 for false and 1 for true (no literals) instead of 'False' and 'True'.

That should resolve your problem, I think.

Cheers.

Read only

0 Likes
611

thanks, I did resolve this problem.

The actual statemetn is as below


 CALL METHOD OF wordobj 'FileSaveAs' EXPORTING #1 = p_file.

p_file is file path.