How to copy between two storages?

How to copy between two storages?

Post by Micha » Thu, 16 Nov 2000 04:00:00



I want copy word documents with custom properties.

Thanks in advance.
Michal

 
 
 

How to copy between two storages?

Post by Jeff Wierer [MS » Thu, 16 Nov 2000 04:00:00


Use the WSS SDK tool Exchange application deployment tool.  It allows you to
create a .cab file of the contents of a WSS folder and then you can use the
.cab to redeploy to another folder in another store.

-Jeff


Quote:> I want copy word documents with custom properties.

> Thanks in advance.
> Michal


 
 
 

How to copy between two storages?

Post by Micha » Fri, 17 Nov 2000 16:44:14


Thanks for your advice. I want copy those files using vbscript in workflow?
Is it possible?

Michal



> Use the WSS SDK tool Exchange application deployment tool.  It allows you
to
> create a .cab file of the contents of a WSS folder and then you can use
the
> .cab to redeploy to another folder in another store.

> -Jeff



> > I want copy word documents with custom properties.

> > Thanks in advance.
> > Michal

 
 
 

How to copy between two storages?

Post by Jeff Wierer [MS » Fri, 17 Nov 2000 04:00:00


No.  You would have to recreate the item. For workflow I might suggest
creating a message with the workflowsession object and let email handling
it.

-Jeff


> Thanks for your advice. I want copy those files using vbscript in
workflow?
> Is it possible?

> Michal



> > Use the WSS SDK tool Exchange application deployment tool.  It allows
you
> to
> > create a .cab file of the contents of a WSS folder and then you can use
> the
> > .cab to redeploy to another folder in another store.

> > -Jeff



> > > I want copy word documents with custom properties.

> > > Thanks in advance.
> > > Michal

 
 
 

How to copy between two storages?

Post by Micha » Sat, 18 Nov 2000 04:00:00


Thanks.
I need copy item from mapi folder to non-mapi folder. I think it is
impossible using email.
I'm trying to recreate the item. I'm openning source stream and copying it
into destination stream.
I need also append some custom property. If I do this (see MyCopy), there is
damage stream of destiantion.

I used MyCopy without appending custom property a after few minutes I
appended it. And everything was ok
I watched state property of stream with no result.

What am I doing wrong?

Michal

Sub MyCopy(destination,item_name)
   Set MapiConn = CreateObject("ADODB.Connection")
   Set MapiRec = CreateObject("ADODB.Record")
   Set NonMapiConn = CreateObject("ADODB.Connection")
   Set NonMapiRec = CreateObject("ADODB.Record")
   Set stm = CreateObject("ADODB.Stream")
   MapiConn.Provider = "ExOLEDB.DataSource"
   MapiConn.Open "file://./BackOfficeStorage/exdom.com/Public
Folders/Michal/WF/"
   NonMapiConn.Provider = "ExOLEDB.DataSource"
   NonMapiConn.connectionstring = destination
   NonMapiConn.Open
   MapiRec.Open "word.doc",Conn,1
   stm.open rec, 1, 4
        st = stm.ReadText(1)
        stm.Position = 0
        If Asc(Mid(st, 1, 1)) = 63 Then '//63 = "?"
            stm.Charset = "ascii"
            stm.Type = 2
        End If
   NonMapiRec.Open item_name,Conn1,3,&H4000000
   set stm1=NonMapiRec.Fields(-1).Value
   stm1.Type = stm.type
   stm1.charset=stm.charset
   stm.Position = 0
   stm.copyto stm1
   stm.close
   stm1.close
   'NonMapiRec.fields.append
"custom_property",MapiRec.fields("custom_property").type,MapiRec.fields("cus
tom_property").definedsize,&H4,MapiRec.fields("custom_property")
   'NonMapiRec.fields.update
   NonMapiRec.close
   NonMapiConn.close
   MapiRec.close
   MapiConn.close
End Sub



> No.  You would have to recreate the item. For workflow I might suggest
> creating a message with the workflowsession object and let email handling
> it.

> -Jeff



> > Thanks for your advice. I want copy those files using vbscript in
> workflow?
> > Is it possible?

> > Michal



> > > Use the WSS SDK tool Exchange application deployment tool.  It allows
> you
> > to
> > > create a .cab file of the contents of a WSS folder and then you can
use
> > the
> > > .cab to redeploy to another folder in another store.

> > > -Jeff



> > > > I want copy word documents with custom properties.

> > > > Thanks in advance.
> > > > Michal

 
 
 

How to copy between two storages?

Post by Jeff Wierer [MS » Sat, 18 Nov 2000 04:00:00


Not sure never tried copying the stream between stores.  You might want to
try using adTypeBinary for the Type since it's a word doc and not a text
file.  Saving it to a local file and then opening the stream from file would
probably be an alternative?

-Jeff


Quote:> Thanks.
> I need copy item from mapi folder to non-mapi folder. I think it is
> impossible using email.
> I'm trying to recreate the item. I'm openning source stream and copying it
> into destination stream.
> I need also append some custom property. If I do this (see MyCopy), there
is
> damage stream of destiantion.

> I used MyCopy without appending custom property a after few minutes I
> appended it. And everything was ok
> I watched state property of stream with no result.

> What am I doing wrong?

> Michal

> Sub MyCopy(destination,item_name)
>    Set MapiConn = CreateObject("ADODB.Connection")
>    Set MapiRec = CreateObject("ADODB.Record")
>    Set NonMapiConn = CreateObject("ADODB.Connection")
>    Set NonMapiRec = CreateObject("ADODB.Record")
>    Set stm = CreateObject("ADODB.Stream")
>    MapiConn.Provider = "ExOLEDB.DataSource"
>    MapiConn.Open "file://./BackOfficeStorage/exdom.com/Public
> Folders/Michal/WF/"
>    NonMapiConn.Provider = "ExOLEDB.DataSource"
>    NonMapiConn.connectionstring = destination
>    NonMapiConn.Open
>    MapiRec.Open "word.doc",Conn,1
>    stm.open rec, 1, 4
>         st = stm.ReadText(1)
>         stm.Position = 0
>         If Asc(Mid(st, 1, 1)) = 63 Then '//63 = "?"
>             stm.Charset = "ascii"
>             stm.Type = 2
>         End If
>    NonMapiRec.Open item_name,Conn1,3,&H4000000
>    set stm1=NonMapiRec.Fields(-1).Value
>    stm1.Type = stm.type
>    stm1.charset=stm.charset
>    stm.Position = 0
>    stm.copyto stm1
>    stm.close
>    stm1.close
>    'NonMapiRec.fields.append

"custom_property",MapiRec.fields("custom_property").type,MapiRec.fields("cus

- Show quoted text -

> tom_property").definedsize,&H4,MapiRec.fields("custom_property")
>    'NonMapiRec.fields.update
>    NonMapiRec.close
>    NonMapiConn.close
>    MapiRec.close
>    MapiConn.close
> End Sub



> > No.  You would have to recreate the item. For workflow I might suggest
> > creating a message with the workflowsession object and let email
handling
> > it.

> > -Jeff



> > > Thanks for your advice. I want copy those files using vbscript in
> > workflow?
> > > Is it possible?

> > > Michal



> > > > Use the WSS SDK tool Exchange application deployment tool.  It
allows
> > you
> > > to
> > > > create a .cab file of the contents of a WSS folder and then you can
> use
> > > the
> > > > .cab to redeploy to another folder in another store.

> > > > -Jeff



> > > > > I want copy word documents with custom properties.

> > > > > Thanks in advance.
> > > > > Michal