‎2009 Mar 12 11:17 AM
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
‎2009 Mar 13 5:43 PM
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.
‎2009 Mar 16 2:15 AM
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.