Forum Replies Created
-
AuthorReplies
-
Yes, you can certainly do this kind of thing with Formativ. Here’s some sample code to help get you started:
dim iMsg dim iFolder '------------------------------------------------------------------------------- ' Main-Line processing '------------------------------------------------------------------------------- Sub Main(Client, GWEvent) on error resume next Set iMsg = Client.ClientState.CommandMessage if not isobject(iMsg) then call msgbox("Please select a message to proceed.", vbInformation, "Message Management") exit sub end if ' Create the destination folder CreateFolder() ' Move the message from the current folder into the destination folder's messages collection call Client.ClientState.SelectedFolder.messages.move(iMsg.MessageID, iFolder.Messages) set iMsg = nothing set iFolder = nothing End Sub '------------------------------------------------------------------------------- ' Create the folder if not exists '------------------------------------------------------------------------------- sub CreateFolder() dim iRootFolders groupwise.account.refresh set iRootFolders = groupwise.account.RootFolder.folders on error resume next set iFolder = iRootFolders.ItemByName("People") if iFolder is nothing then set iFolder = iRootFolders.add("People") end if set iRootFolders = nothing end subI hope this helps.
Advansys Support
Here is some sample code. You will need to past this into your Sub Main() subroutine:
dim iStatusDlg set iStatusDlg = Utilities.NewStatusDialog iStatusDlg.title = "Initializing...[Please wait]" iStatusDlg.ProgressRange = 3 ' Show the cancel button. iStatusDlg.CanCancel = TRUE iStatusDlg.show ' Main text iStatusDlg.MainText = "Main text goes here" ' Status text and the progress position iStatusDlg.StatusText = 1 iStatusDlg.ProgressPosition = 1 msgbox "Status Position: " & 1 iStatusDlg.StatusText = 2 iStatusDlg.ProgressPosition = 2 msgbox "Status Position: " & 2 iStatusDlg.StatusText = 3 iStatusDlg.ProgressPosition = 3 msgbox "Status Position: " & 3 ' if the status cancel button pressed if iStatusDlg.Cancel then msgbox "Cancel button pressed." end if set iStatusDlg = nothingI hope this helps.
Advansys Support
Thanks for the update. As you discovered, the FileSystemObject is a component of the script host.
Advansys Support
At the moment no – the only workarounds is to import the keys as you have suggested, or to install runtime while logged in as the current user.
Formativ 1.6 is about to be released in the next week or so (which I understand will be a free ungrade from 1.5). 1.6 contains a number of changes to the installation and registry usage that should alleviate this situation somewhat. Watch http://www.advansyscorp.com for an announcement.
Advansys Support
Do you mean how do you obtain the message ID from a work in progress message? ItemMessageIDFromView should still give you the appropriate message ID of a saved message (but it will be a ‘proper’ message ID, as opposed to ‘X00’, because saved draft messages exist in the GroupWise message store).
I feel I am probably not understanding exactly what you want to do. Please provide more details and I’m sure I’ll be able to assist further.
Advansys Support
At the moment the only way to control event sequencing is to rename your applets. Formativ executes applets in response to events in alphabetical order. Try renaming the appropriate applets, i.e. ‘a_Corporate Disclaimer’, ‘b_Terms of use’.
Advansys Support
The GroupWise.CancelGroupWiseEvent should do what you want. You will need to be using a more recent version of Formativ for this work (1.5.3 or newer I suspect).
Here’s an example. Integrate this applet on the email On Send event, restart the client if required, then try to send an email message.
Sub Main(Client, GWEvent) if MsgBox("Do you accept the terms and conditions?", vbYesNo, "Formativ") = vbNo then GroupWise.CancelGroupWiseEvent = true end if End SubI hope this helps.
Advansys Support
Could you please email an example HTML signature file to support@advansyscorp.com.
Thanks,
Advansys Support
Eric,
A couple of us here have independently confirmed that the example code we posted does work. What were the exact errors you received when you ran our example code as-is?
AddressBookEntries is a property of the Object API AddressBook object. Here’s a link to the official Novell documentation for the AddressBook object:
Address Book Object documentation
Unfortunately, we could not get your code to run. The Object API AddressBook object does not have a count property. Is it possible the code you have posted is not exactly the same code as you are running? Formativ provides two ways to access the address books:
1) Via the wrapped address book objects exposed via the GroupWise.AddressBooks property. I suspect this might be the object you are referring to, as the AddressBook object exposed from here does have a Count property. However, this is not the object set our example code is using.
2) Via the native Object API, which is exposed via GroupWise.Account.AddressBooks. This object set is actually the native GroupWise Object API, and does have an AddressBookEntries property. This is the object our example code is using.
Regards,
Advansys Support
Thanks,
Advansys Support
I suspect Formativ has been installed while logged in as the Administrator on this PC. The Formativ installer creates a number of keys under HKEY_CURRENT_USER. The resolution would be to install Formativ Runtime while logged in as the current user.
Advansys Support
You generally need to work backwards when deleting items from a collection. Starting from the beginning, the value of Count decreases after each delete, resulting in some items being left over.
The following code should do what you want:
Sub Main(Client, GWEvent) Dim objAddressBooks Dim objAddessBook Dim objAddressBookEntry Dim iCount Dim x ' Get the address books object Set objAddressBooks = GroupWise.Account.AddressBooks ' Locate the address book called "Test Account" Set objAddressBook = objAddressBooks.Item("Test Account") iCount = objAddressBook.AddressBookEntries.Count for x = iCount to 1 step -1 set objAddressBookEntry = objAddressBook.AddressBookEntries.Item(x) objAddressBookEntry.Delete next Set objAddressBooks = nothing End SubAdvansys Support
Thank you very much Ralf!
Advansys Support
Hello Ralf,
MemoControl1.Text contains plain ASCII text. Hard returns are represented by standard CR/LF codes (i.e Char(13) & Chr(10)). Inserting plain text into RTF formatted text will not automatically convert the plain text hard returns in to RTF paragraphs.
I suspect you will need to write a plain text -> RTF conversion function that at the very least converts Chr(13) & Chr(10) codes into RTF par’s. Your code would look something like:
NewMsg.BodyText = "{rtf1ansiansicpg1252uc1 {bb" & PlainToRTF(MemoControl1.Text) & "b}"I hope this helps.
Advansys Support
Thanks for your input Ralf!
Advansys Support
Thank you for your contribution.
Advansys Support
-
AuthorReplies