×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Disable integration with ProjectWise

Disable integration with ProjectWise

Disable integration with ProjectWise

(OP)
How can I disable integration with ProjectWise in Word’s VBA?
Recording a macro in Word comes empty sad

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: Disable integration with ProjectWise

Funnily enough was engaged in an international ProjectWise deployment earlier today ...

Not really involved on trhe application side though ... as I recall Projectwise integration is done through a C OM addin - so we could programmatically disable the addin, eg:

CODE

Sub toggleprojectwisecomaddin()
    Dim lngIndex As Long
    For lngIndex = 1 To Application.COMAddIns.Count
        If Application.COMAddIns(lngIndex).Description = "ProjectWise iDesktop Integration" Then ' possible your Projectwise comm addin  name may vary
            Application.COMAddIns(lngIndex).Connect = Not Application.COMAddIns(lngIndex).Connect ' toggle connect status
            Exit For
        End If
    Next
End Sub 

RE: Disable integration with ProjectWise

If it is a COMaddin, then switch the Connect property to False.

combo

RE: Disable integration with ProjectWise

(OP)
Detected: "ProjectWise iDesktop Integration" smile
Tried:
Application.COMAddIns(lngIndex).Connect = Not Application.COMAddIns(lngIndex).Connect
and
Application.COMAddIns(lngIndex).Connect = False

Got:
This add-in is installed for all users on this computer and can only be connected or disconnected by an administrator. sad

Is there a way to just Disable it?

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: Disable integration with ProjectWise

A dirty trick that may help is to open word in safe mode. It will run without any extensions.
Either open word with Ctrl key pressed or run from command line with /safe switch. Addin can be disabled with /a switch (https://support.microsoft.com/en-us/office/command...). If any of switches works, it is possible to create shortcut to word with specific switch.

combo

RE: Disable integration with ProjectWise

(OP)
Thanks combo, but I run Word from VB(6) app and user does not even see Word on the screen.
I just create a whole bunch of docx files and save them also as pdf files to the server behind the scenes.
ProjectWise just causes some issues in this process...mad

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: Disable integration with ProjectWise

>Is there a way to just Disable it?

Bentley themselves only document two ways.: using the disable button on the menu, or the Connect method illustrated above (albeit not a code version - "You can disable integration from inside the application by clicking the File menu , selecting Options > Add-Ins > Com Add-ins, and turning off the ProjectWise add-in you want to disable")

The COMAddin itself does not expose any methods that can be used by VBA that I can find. Perhaps you can ask Bentley themselves

RE: Disable integration with ProjectWise

If the path to Winword.exe is known, you can open Word using Shell, and having switch (/a) added to the patch. Next get Word with GetObject.

combo

RE: Disable integration with ProjectWise

/a doesn't stop com addins ... You need /safe - and /safe causes a startup dialog the user would need to click ...

RE: Disable integration with ProjectWise

Quote (strongm)

/a doesn't stop com addins ...
MS description of office switches, for word:
/a
Starts Word and prevents add-ins and global templates (including the Normal template) from being loaded automatically. The /a switch also locks the setting files.


For me, Application.COMAddIns.Count in Immediate window, returns 2 if word started normally, run-time automation error if by 'winword.exe /a' in command line. However, there is no difference in COMaddins window.

combo

RE: Disable integration with ProjectWise

Well, worth a short then!

RE: Disable integration with ProjectWise

If Word is closed, picking word on my computer as below takes around 3 seconds if it was previously open, up to around 15 for fresh windows session. If Word is running, GetObject finds first task, don't know the way to get specific ID.

CODE --> Excel_VBA

Public Sub Test()
Dim appWord As Word.Application
On Error Resume Next
    Set appWord = GetObject(, "Word.Application")
    If Err.Number = 0 Then
    MsgBox "Close Word and start again"
    Set appWord = Nothing
Else
    Err.Clear
    On Error GoTo 0
    ID = Shell("winword.exe /a", vbMaximizedFocus)
    Set appWord = GetWord(30)
    If appWord Is Nothing Then
        MsgBox "Need a bit more time..."
    Else
        appWord.Visible = True
    End If
End If
End Sub

Public Function GetWord(MaxWaitSeconds As Integer) As Word.Application
On Error Resume Next
For i = 1 To MaxWaitSeconds
    Application.Wait (Now + TimeValue("0:00:01"))
    DoEvents
    Set GetWord = GetObject(, "Word.Application")
    If Err.Number <> 0 Then Err.Clear Else Exit For
Next i
MsgBox i
End Function 

combo

RE: Disable integration with ProjectWise

(OP)
Long story short…
Since there is no way (AFAIK) to control ProjectWise Desktop Integration Add-In thru VBA code, I simply decided to allow users to start Word (that’s on Citrix) and allow them to Disable ProjectWise.
If I cannot do it (as a programmer), then I simply say to the user: “You do it yourself.”
Not a very high-tech approach… sad

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close