Forum Replies Created
-
AuthorReplies
-
Good suggestion on copying it to a temp directory. Thank you.
Thank you for all your suggestions. I am already utilizing the methods described, but I wanted to push it further to help organize my ever-increasing code base more.
The error I spoke of actually appears when I click on the Rename button, not only the Edit button. So that did not work for me.
The solution I figured out was to use a binary editor to edit the .VBF and .VB~ files to change the name in the XML code. That worked for me. Notepad did not work as it destroyed the binary form data.
Backups of forms (using export) and copying the VBF files is now a regular part of my work process. 🙂
The OpenFileDlg is the method I am currently using. The drag and drop feature was a user request which I thought would be useful.
I have made a little progress on a solution using the DynamicWrapper ActiveX control that allows me to call Windows API.
Dim UserWrap Set UserWrap = CreateObject("DynamicWrapper") UserWrap.Register "SHELL32.DLL", "DragAcceptFiles", "i=Hl","f=s" UserWrap.DragAcceptFiles Dlg.Handle, True
This successfully shows a drag cursor on my Formativ form suggesting it can accept files dragged to it. However, I am still working on the code which allows me to capture the WM_DROPFILES messages from Windows to decode the actual file path using another Windows API: DragQueryFile.
I see that most controls (including the form) have a method called WindowProc, but I am unsure how to override it in VBScript. Perhaps it is not even exposed in Formativ? Is there any way I can tap into the WindowProc so that I can receive those messages?
I am using the following article as guide to my efforts: Drag and Drop from Windows Explorer
[This message was edited by ctaleck on September 11, 2008 at 06:25 AM.]
I’m not sure why I had the ItemSaveMessageDraft commented out. Tired mistake…
I tried using your cleaned up code and finally got a message ID. However, I got the message ID of the “original” message, not the “reply” message.
It turns out that I’ve had the “integration” setup incorrectly.
In all my tests, I’ve had integrations set to run the code BEFORE the “OnReply” event.
I changed it to run AFTER “OnReply” and it successfully retrieves the “reply” message ID.
I guess the moral of this exchange is that no assumptions should be made about which integrations are being used during tests.
[This message was edited by ctaleck on July 17, 2008 at 06:15 AM.]
For the record, here is the code I was working with. The result is a still “X00” during the iterations.
Sub Main(Client, GWEvent) dim iWIPFolderPath dim oMsg dim iMsgID dim iWIPPath Dim iBreakCount ' Save the draft message to the Work in Progress folder Call Groupwise.ItemSetText("X00", itfSubject, " COMPLETED", TRUE) ' TRUE = Append Utilities.Trace "iWIPPath=" & iWIPPath 'Groupwise.ItemSaveMessageDraft(iWIPPath) Call Groupwise.throwtoken("ItemSaveMessageDraft(""" & iWIPPath & """)", iReturnVal) MsgBox "ItemSaveMessageDraft returns " & iReturnVal ' Calling ItemMessageIDFromView immediately after GroupWise.ItemSaveMessageDraft ' can result in an X00 ID. iMsgID = GroupWise.ItemMessageIDFromView iBreakCount = 0 while (iMsgID = "Token failed execution!") or (iMsgID = "X00") Application.ProcessMessages utilities.Timer(1) Application.ProcessMessages iMsgID = GroupWise.ItemMessageIDFromView iBreakCount = iBreakCount + 1 Utilities.Trace iBreakCount & ": " & iMsgID if (iBreakCount > 10) then exit sub end if wend set oMsg = GroupWise.Account.GetMessage(iMsgID) msgbox oMsg.subject.plaintext End Sub '------------------------------------------------------------------------------- ' Get full path of the Work-In-Progress folder where Drafts are saved '------------------------------------------------------------------------------- Function GetWIPFolderPath(aGWFolder, byref aPath) Dim sHome sHome = "" Utilities.Trace "aGWFolder.Name=" & aGWFolder.Name & " aPath=" & aPath If (Cint(Left(GroupWise.EnvVersionName,1)) >= 7) Then If aGWFolder.Name = GroupWise.Account.Owner.DisplayName Then sHome = " Home" End If End If If aGWFolder Is Nothing Then Exit Function End If If (aPath <> "") Then aPath = aGWFolder.name & sHome & "" & aPath Else aPath = aGWFolder.name End If If (aGWFolder.objtype = fgwRoot) Then Exit Function Else Call GetWIPFolderPath(aGWFolder.ParentFolder, aPath) End if End Function
I just reviewed again the thread on this forum about this problem and I’ve decided to tackle it in a different manner as there appears to be no resolution to the “custom field in a draft message” problem.
Too bad, as I was trying to avoid having to re-create an e-mail form just to send a reply with some data attached to a custom field.
There was a suggestion to put the data in the body of the message at the bottom, which I might consider, but does not seem as clean.
You are right, I am using GW 7. But, I get the string “7.0.2 HP” for the EnvVersionName so that the following code returns FALSE for me.
(GroupWise.EnvVersionName > "7")
I had to modify it to make it thusly:
(Cint(Left(GroupWise.EnvVersionName,1))) >= 7)
However, I then had to deal with the fact that the “Work In Progress” folder was in another folder. So I used the code above combined the “GetWIPFolderPath” function found elsewhere on these forums for that.
But then… I figured out that you need to modify the draft message before it can be saved so I used this code:
Call Groupwise.ItemSetText("X00", itfSubject, " COMPLETED", TRUE)
Now the message is saved in the “Work In Progress” folder. Yeah!
But alas, I still get an “X00” message ID for all the iterations. What else am I missing? Is some sort of “refresh” needed?
I found this code, but it does not work also. I get “X00” as the ID during the while loop.
dim oMsg dim iMsgID dim iWIPPath Dim iBreakCount ' Save the draft message to the Work in Progress folder iWIPPath = GroupWise.Account.Owner.DisplayName & "" & GroupWise.Account.WorkFolder.Name Utilities.Trace "iWIPPath=" & iWIPPath Groupwise.ItemSaveMessageDraft(iWIPPath) ' Calling ItemMessageIDFromView immediately after GroupWise.ItemSaveMessageDraft ' can result in an X00 ID. iMsgID = GroupWise.ItemMessageIDFromView iBreakCount = 0 while (iMsgID = "Token failed execution!") or (iMsgID = "X00") Application.ProcessMessages utilities.Timer(1) Application.ProcessMessages iMsgID = GroupWise.ItemMessageIDFromView iBreakCount = iBreakCount + 1 Utilities.Trace iBreakCount & ": " & iMsgID if (iBreakCount > 10) then exit sub end if wend set oMsg = GroupWise.Account.GetMessage(iMsgID)
I am fairly new to Formativ and I do not see how the ChainApplet() method would allow you to call a function in another applet and then return a value.
It seems to me that things could get very messy trying to pass values through the Utilities.TransferData property and the whole business of the first applet having to quit before the other one can start and then start up the calling applet to receive the value would really affect performance.
Can you elaborate more on the technique?
Is this still true for version 2.0 of Formativ? It would certainly be a very helpful feature for code reuse.
I’m sorry, I guess I should have put this under the forum called “Free Solutions from GroupWise Cool Solutions or Advansys” as it is the exact code you supplied for the “TUT333 – Object API ActiveX – Message Store.
Specifically, when this code is executed:
Sub btnSpellCheckClick(Sender) call GroupWise.InvokeSpellerForWindow(NewMsgDlg.mBody.Handle, false) End Sub
How would I go about getting the source code for the Stationery sample? The version I have is Flexlocked.
I created a sample form from your suggestion and got it working. Although the Font Dialog is not exactly similar to the toolbar concept I was looking for, it does get the job done in those rare cases where someone would want to format their text.
I tried looking for more documentation on the THTMLEditorEx but was not successful. I found other references to “THTML” but none of them with “EditorEx.” Specifically, I would like to know how to get the text of out the control and either into a variable or back into the text file in the temp dir.
I searched each of these help files in the Delphi help files as suggested in the readme.txt:
dbxpress.hlp
del6com.hlp
del6cw.hlp
del6dap.hlp
del6dbd.hlp
del6iota.hlp
del6new.hlp
del6op.hlp
del6prog.hlp
del6vcl.hlp <- I assume this is the file to search, but I tried all of them anyway…
delphi6.hlp
dlx1clx.hlp
ibx.hlpAlso, your button code should be htmlEditor:
Sub btnFontClick(Sender) Maindlg.htmlEditor.Fontdialog End Sub
[This message was edited by ctaleck on May 28, 2008 at 12:54 PM.]
ftp://ftpc.borland.com/pub/delphi/techpubs/delphi6/d62pro.zip
http://www.raize.com/DevTools/RzComps/DemoTrial/RC3Trial.zipThese links no longer work.
Is there updated information available?
-
AuthorReplies