This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - MS Office integration with Aras

rk_7564 - Friday, April 27, 2012 6:41 AM:

Hi,

i have created a vb macro in word 2007. Its working fine.  while i do the same thing in another machine with  Word 2010 its giving the error.

My system configuration:

OS : windows 7

.Net Framework : 4.0

Aras : 9.3

MS Office : 2010

Pls take a look on my screenshot

 

Thanks,

RK

Macro Program:

Sub rk()

 

URL = "localhost/.../InnovatorServer.aspx"

Db = "Demo93"

user = "admin": pw = "innovator"

Dim f As New IomFactory 'must use the New keyword

Dim innov As Innovator

Set innov = f.CreateInnovator(Nothing)

Dim conn As HttpServerConnection

Set conn = f.CreateHttpServerConnection(URL, Db, user, pw)

Dim result As Item

Set result = conn.Login

If result.IsError Then

   MsgBox result.getErrorDetail

Exit Sub

End If

Set innov = f.CreateInnovator(conn)

 

    If Dialogs(wdDialogFileSaveAs).Show = 0 Then Exit Sub

    System.Cursor = wdCursorNormal

 

Dim usr As Item

Set usr = innov.newItem("Document", "add")

usr.setProperty "name", ActiveDocument.name

usr.setProperty "description", ActiveDocument.FullName

 

    Dim fname As String

    fname = ActiveDocument.name

 

    Dim fpath As String

    fpath = ActiveDocument.FullName

 

    Dim relItem As Item

    Set relItem = innov.newItem("Document File", "add")

 

    Dim fileItem As Item

    Set fileItem = innov.newItem("File", "add")

    fileItem.setProperty "filename", ActiveDocument.name

    fileItem.attachPhysicalFile (ActiveDocument.FullName)

 

    usr.addRelationship relItem

    relItem.setRelatedItem fileItem

 

Set usr = usr.Apply()

If (usr.IsError) Then

    MsgBox result.getErrorDetail

End If

conn.Logout

 

End Sub



Yoann Maingon - Friday, April 27, 2012 11:52 AM:

Can you repost your screenshot?



rk_7564 - Sunday, April 29, 2012 10:46 PM:

i have attached screenshot.

Thanks & Regards,

RK