Ask Your Question
0

How to save a file on current path and particular path (eg. d:\) using macro.(using open office 2.0)

asked 2019-02-07 18:19:54 +0100

raj80152 gravatar image

How to save a file on current path and particular path using macro.

edit retag flag offensive close merge delete

Comments

gabix gravatar imagegabix ( 2019-02-08 14:18:16 +0100 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2019-04-06 03:38:53 +0100

raj80152 gravatar image

Sub Writer_ToDocumentFolder(Optional pDoc As Object) REM Reworked to also run in very old versions. If IsMissing(pDoc) Then theDoc = ThisComponent Else theDoc = pDoc End If docUrl = theDoc.URL If NOT FileExists(docUrl) Then MsgBox("The document must be saved to an URL for this routine to work.") Exit Sub End If If NOT theDoc.supportsService("com.sun.star.text.TextDocument") Then Exit Sub End If doc1 =Right(docURL,Len(docURL)-9) cspath = ("file:///E" & doc1) Dim storeArgs(0) As New com.sun.star.beans.PropertyValue storeArgs(0).Name = "FilterName" storeArgs(0).Value = "StarWriter 5.0"

theDoc.storeToURL(cspath, storeArgs()) MsgBox("transfered" & cspath)

End Sub

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-02-07 18:19:54 +0100

Seen: 71 times

Last updated: Apr 06