#7171
Support 1
Participant

    Cathy,

    The following is from your post in a different thread, which I think was actually intended for this thread.

    quote:


    We have this working. To get it working, we had to set the custom view path under Tools – Environment in GroupWise even though the path is hard coded.

    Now, we have run into an issue with another piece of the code. The following code is not inserting a graphic. This works on two laptops but not on the majority of PCs.

    If ActivityRoom.RoomSetup.itemindex = 0 then
    ActivityRoom.RoomSetupImage.Picture.LoadFromFile_(“p:GroupWiseViewsactivityroomregularactivity.jpg”)
    Utilities.CopyHTMLToClipboard(“
    “)
    End If

    The user has rights to the folder and the graphic is displayed on the form it is just not inserted into the message area. The following is the entire code:

    ‘ Activity Room

    Sub Main(Client, GWEvent)
    Dim iFilePath

    Call GroupWise.ViewOpenFile_(“p:GroupWiseViewsFormativGWViewsResActivity”, “”, “”)
    if ActivityRoom.ShowModal = MROK then
    Call groupwise.focusset(fcsMessage, “”)
    GroupWise.EditPaste
    Call groupwise.focusset(fcsSubject, “”)
    end if

    End Sub

    Sub RoomSetupChange(Sender)

    If ActivityRoom.RoomSetup.itemindex = 0 then
    ActivityRoom.RoomSetupImage.Picture.LoadFromFile_(“p:GroupWiseViewsactivityroomregularactivity.jpg”)
    Utilities.CopyHTMLToClipboard(“
    “)
    End If

    If ActivityRoom.RoomSetup.itemindex = 1 then
    ActivityRoom.RoomSetupImage.Picture.LoadFromFile_(“p:GroupWiseViewsactivityroomyoga.jpg”)
    Utilities.CopyHTMLToClipboard(“
    “)
    End If

    If ActivityRoom.RoomSetup.itemindex = 2 then
    ActivityRoom.RoomSetupImage.Picture.LoadFromFile_(“p:GroupWiseViewsNoSetupNeeded.jpg”)
    Utilities.CopyHTMLToClipboard(“
    “)
    End If
    End Sub


    Can you confirm whether or not the custom view is loading? I have heard (but not confirmed) that the GroupWise token ViewOpenFile() should be used with an unqualified filename, ie.

      call GroupWise.ViewOpenFile("ResActivity", "", "")

    where the custom view path is defined in Tools | Environment.

    An image will not be loaded into the message area when:

    • the message view is not the active window, or
    • the compose mode is plain-text, not HTML.

    Here is a snippet of code that might solve both of these potential problems:

      call GroupWise.ViewOpenFile(iFileName, "", "")
      iHwnd = Utilities.FindWindow("OFMailView","")
      if ActivityRoom.ShowModal = MROK then
        if not ComposingMessageIsHTML(iHwnd) then
          call GroupWise.SwitchToHTMLView
          Application.ProcessMessages
          call Groupwise.FocusSet(fcsMessage, "")
          Groupwise.EditPaste
          ...
        end if
      end if
    
    function ComposingMessageIsHTML(aHwnd)
      on error resume next
      if aHwnd <> 0 then
        Utilities.SetForegroundWindow(aHwnd)
      end if
      ComposingMessageIsHTML = (GroupWise.EnvEditorStyle = 2)
    end function

    I hope the above information is helpful.

    Advansys Support