Groups > WordPerfect Office > WordPerfect X3 > Re: Thunderbird and attachments




Re: Thunderbird and attachments

Re: Thunderbird and attachments
Tue, 15 Apr 2008 21:16:02 -050
You need to check vAttachment.

Prior to sending keys:

	If (vPasteWPDContents=True or vSendNow=True)
		Repeat
			Wait(1)
		Until(Applocate("Compose: "+vSubject)<>0)
	EndIf

I added the routine above and this to the TBEmail() wpu Code Snippet to 
address a missing file(s) and focus issues:

	//Check that each file exists if attached
	If (vAttachment<>"")
		ForEach (x; StrParseList(vAttachment; ","))
			If (NOT(DoesFileExist(x)))
				MessageBox(;"File Does Not Exist";x;IconStop!)
				Quit()
			EndIf
		EndFor
	EndIf


Post Reply
Thunderbird and attachments
Tue, 15 Apr 2008 22:00:16 -040
This is my code that hangs up at the Compose window and stops. If I 
manually click on Send then it hangs up on trying to attach the 
attachment. I commented out the Quit () to see if that made a 
difference, but no. I don't see the need for a Quit () line anyway if 
the macro is only going to stop when it is done anyway.

Vic

Application (WordPerfect; "WordPerfect"; Default!; "EN")
	//Display(On!) Step(On!)
//Get the email address to the clipboard.
FileOpen (Filename: "C:\LifeModTest\EmailData.wpd")
SearchString (StrgToLookFor: "@")
SearchNext (SearchMode: Extended!)
SelectMode (State: Off!)
PosLineBeg ()
SelectMode (State: On!)
PosLineEnd ()
PosCharPrevious ()        //To skip the Hard Return.
EditCopy ()             //Copies the client's email address to the 
clipboard.
SelectMode (State: Off!)

v=ClipboardGet 	//v now equals the client's email address.
vTo=v
vSubject="LIA Questionnaire Report of Findings"
vBody="Thank you for participating."

//Get pdf file name onto the clipboard.
PosDocTop ()
SearchString (StrgToLookFor: "[[")
SearchNext (SearchMode: Extended!)
SelectMode (State: Off!)
PosLineEnd ()
Type (Text: ".pdf")        //Types the extension on the name.
SelectMode (State: On!)
PosLineBeg ()
EditCopy ()		//Copies the PDF file name to the clipboard.
CloseNoSave ()	//Closes the file without saving the changes.

c=ClipboardGet
vPath= "C:\LifeMod\Reports\"
vAttachment=vPath+c
vPasteWPContents=False
vSendNow=True

TBEmail(vTo; vSubject; vBody; vAttachment; vSendNow)
//Quit ()
/////////////////////////////////////////////////////

Procedure TBEmail(vTo; vSubject; vBody; vAttachment; vSendNow)
	tbEXE="C:\Program Files\Mozilla Thunderbird\thunderbird.exe"

	args=" -compose "
	to="to='"+vTo+"'"
	subject="subject="+vSubject
	attachment="attachment="+vAttachment
	body="body="+vBody
	tb=tbEXE+args+to+","+subject+","+attachment+","+b
ody

	DllCall ProtoType 
WinExec("kernel32.dll";"WinExec";DWord!;{AnsiString(lpCmdLin
e);nCmdShow})
	WinExec(tb; 0)

	InhibitInput(Off!)
	Display(On!)	
	
	If (vSendNow=True)
		SendKeys("{Ctrl+Enter}")
	EndIf
EndProc
Post Reply
Re: Thunderbird and attachments
Tue, 15 Apr 2008 22:08:19 -040
I know a wee bit more now.
When I shut down Thunderbird before playing the macro, (lol don't say 
it) then I get a hard page appearing in the blank wp file that was up 
and the compose window appears on the task bar and is blinking. The 
email did not send.
Vic



Victor Ouellette wrote:
> 
> This is my code that hangs up at the Compose window and stops. If I 
> manually click on Send then it hangs up on trying to attach the 
> attachment. I commented out the Quit () to see if that made a 
> difference, but no. I don't see the need for a Quit () line anyway if 
> the macro is only going to stop when it is done anyway.
> 
> Vic
> 
> Application (WordPerfect; "WordPerfect"; Default!;
"EN")
>     //Display(On!) Step(On!)
> //Get the email address to the clipboard.
> FileOpen (Filename: "C:\LifeModTest\EmailData.wpd")
> SearchString (StrgToLookFor: "@")
> SearchNext (SearchMode: Extended!)
> SelectMode (State: Off!)
> PosLineBeg ()
> SelectMode (State: On!)
> PosLineEnd ()
> PosCharPrevious ()        //To skip the Hard Return.
> EditCopy ()             //Copies the client's email address to the 
> clipboard.
> SelectMode (State: Off!)
> 
> v=ClipboardGet     //v now equals the client's email address.
> vTo=v
> vSubject="LIA Questionnaire Report of Findings"
> vBody="Thank you for participating."
> 
> //Get pdf file name onto the clipboard.
> PosDocTop ()
> SearchString (StrgToLookFor: "[[")
> SearchNext (SearchMode: Extended!)
> SelectMode (State: Off!)
> PosLineEnd ()
> Type (Text: ".pdf")        //Types the extension on the name.
> SelectMode (State: On!)
> PosLineBeg ()
> EditCopy ()        //Copies the PDF file name to the clipboard.
> CloseNoSave ()    //Closes the file without saving the changes.
> 
> c=ClipboardGet
> vPath= "C:\LifeMod\Reports\"
> vAttachment=vPath+c
> vPasteWPContents=False
> vSendNow=True
> 
> TBEmail(vTo; vSubject; vBody; vAttachment; vSendNow)
> //Quit ()
> /////////////////////////////////////////////////////
> 
> Procedure TBEmail(vTo; vSubject; vBody; vAttachment; vSendNow)
>     tbEXE="C:\Program Files\Mozilla Thunderbird\thunderbird.exe"
> 
>     args=" -compose "
>     to="to='"+vTo+"'"
>     subject="subject="+vSubject
>     attachment="attachment="+vAttachment
>     body="body="+vBody
>    
tb=tbEXE+args+to+","+subject+","+attachment+","+bo
dy
> 
>     DllCall ProtoType 
>
WinExec("kernel32.dll";"WinExec";DWord!;{AnsiString(lpCmdLin
e);nCmdShow})
>     WinExec(tb; 0)
> 
>     InhibitInput(Off!)
>     Display(On!)   
>     
>     If (vSendNow=True)
>         SendKeys("{Ctrl+Enter}")
>     EndIf
> EndProc
> 
Post Reply
Re: Thunderbird and attachments
Wed, 16 Apr 2008 00:16:16 -040
When I play a test macro that opens the pdf file I get it opening.

1.  Application (WordPerfect; "WordPerfect"; Default!;
"EN")
2.  FileOpen (Filename:
"C:\LifeModTest\Reports\[[{11(2test01)}DrO]].pdf")

The result is the pdf file opens so that file does exist.

I use the file EmailData with the following six lines.
- - - - - - - -
EmailData file
DrO
01
[[{11(2test01)}DrO]]
info@painreliefdiet.com
 >>>>
- - - - - - - - -


When I play the following macro I get the File does not exist message 
box over the WP file that is blank and the compose window comes up on 
the taskbar.


1.	Application (WordPerfect; "WordPerfect"; Default!; "EN")
2.		//Display(On!) Step(On!)
3.	//Get the email address to the clipboard.
4.	FileOpen (Filename: "C:\LifeModTest\EmailData.wpd")
5.	SearchString (StrgToLookFor: "@")
6.	SearchNext (SearchMode: Extended!)
7.	SelectMode (State: Off!)
8.	PosLineBeg ()
9.	SelectMode (State: On!)
10.	PosLineEnd ()
11.	PosCharPrevious ()        //To skip the Hard Return.
12.	EditCopy ()             //Copies the client's email address to the 
clipboard.
13.	SelectMode (State: Off!)
14.	
15.	v=ClipboardGet 	//v now equals the client's email address.
16.	vTo=v
17.	vSubject="LIA Questionnaire Report of Findings"
18.	vBody="Thank you for participating."
19.	
20.	//Get pdf file name onto the clipboard.
21.	PosDocTop ()
22.	SearchString (StrgToLookFor: "[[")
23.	SearchNext (SearchMode: Extended!)
24.	SelectMode (State: Off!)
25.	PosLineEnd ()
26.	Type (Text: ".pdf")        //Types the extension on the name.
27.	SelectMode (State: On!)
28.	PosLineBeg ()
29.	EditCopy ()		//Copies the PDF file name to the clipboard.
30.	CloseNoSave ()	//Closes the file without saving the changes.
31.	
32.	c=ClipboardGet
33.	vPath= "C:\LifeMod\Reports\"
34.	vAttachment=vPath+c
35.	vPasteWPContents=False
36.	vSendNow=True
37.	
38.	TBEmail(vTo; vSubject; vBody; vAttachment; vSendNow)
39.	Quit ()
40.	/////////////////////////////////////////////////////
41.	
42.	Procedure TBEmail(vTo; vSubject; vBody; vAttachment; vSendNow)
43.		tbEXE="C:\Program Files\Mozilla Thunderbird\thunderbird.exe"
44.	
45.		args=" -compose "
46.		to="to='"+vTo+"'"
47.		subject="subject="+vSubject
48.		attachment="attachment="+vAttachment
49.		body="body="+vBody
50.		tb=tbEXE+args+to+","+subject+","+attachment+",&quo
t;+body
51.	
52.		DllCall ProtoType
53. 
WinExec("kernel32.dll";"WinExec";DWord!;{AnsiString(lpCmdLin
e);nCmdShow})
54.		WinExec(tb; 0)
55.	
56.		InhibitInput(Off!)
57.		Display(On!)	
58.	
59.	If (vSendNow=True)
60.	        Repeat
61.	            Wait(1)
62.	        Until(Applocate("Compose: "+vSubject)<>0)
63.	    EndIf
64.	
65.	
66.	    //Check that each file exists if attached
67.	    If (vAttachment<>"")
68.	        ForEach (x; StrParseList(vAttachment; ","))
69.	            If (NOT(DoesFileExist(x)))
70.	                MessageBox(;"File Does Not Exist";x;IconStop!)
71.	                Quit()
72.	            EndIf
73.	        EndFor
74.	    EndIf
75.	
76.		If (vSendNow=True)
77.			SendKeys("{Ctrl+Enter}")
78.		EndIf
79.	EndProc
80.	



Vic




Kenneth Hobson wrote:
> 
> You need to check vAttachment.
> 
> Prior to sending keys:
> 
>     If (vPasteWPDContents=True or vSendNow=True)
>         Repeat
>             Wait(1)
>         Until(Applocate("Compose: "+vSubject)<>0)
>     EndIf
> 
> I added the routine above and this to the TBEmail() wpu Code Snippet to 
> address a missing file(s) and focus issues:
> 
>     //Check that each file exists if attached
>     If (vAttachment<>"")
>         ForEach (x; StrParseList(vAttachment; ","))
>             If (NOT(DoesFileExist(x)))
>                 MessageBox(;"File Does Not Exist";x;IconStop!)
>                 Quit()
>             EndIf
>         EndFor
>     EndIf
> 
> 
> 
Post Reply
Re: Thunderbird and attachments
Wed, 16 Apr 2008 00:39:24 -040
Kenneth
With regard to this last post listed below I think it may be easier for 
you to ignore all this stuff below and instead explain to me how to get 
your code that was in the tbemail.zip file on the wpu thread to include 
the pdf file and exclude the wpd file. That code works on my computer, 
but it includes a wpd file as an attachment. If could get the wpd 
attachment out of there and the pdf one in there then I would be willing 
to spend the next few days (or weeks) getting my data into that macro.

Vic






Victor Ouellette wrote:
> 
> When I play a test macro that opens the pdf file I get it opening.
> 
> 1.  Application (WordPerfect; "WordPerfect"; Default!;
"EN")
> 2.  FileOpen (Filename:
"C:\LifeModTest\Reports\[[{11(2test01)}DrO]].pdf")
> 
> The result is the pdf file opens so that file does exist.
> 
> I use the file EmailData with the following six lines.
> - - - - - - - -
> EmailData file
> DrO
> 01
> [[{11(2test01)}DrO]]
> info@painreliefdiet.com
>  >>>>
> - - - - - - - - -
> 
> 
> When I play the following macro I get the File does not exist message 
> box over the WP file that is blank and the compose window comes up on 
> the taskbar.
> 
> 
> 1.    Application (WordPerfect; "WordPerfect"; Default!;
"EN")
> 2.        //Display(On!) Step(On!)
> 3.    //Get the email address to the clipboard.
> 4.    FileOpen (Filename: "C:\LifeModTest\EmailData.wpd")
> 5.    SearchString (StrgToLookFor: "@")
> 6.    SearchNext (SearchMode: Extended!)
> 7.    SelectMode (State: Off!)
> 8.    PosLineBeg ()
> 9.    SelectMode (State: On!)
> 10.    PosLineEnd ()
> 11.    PosCharPrevious ()        //To skip the Hard Return.
> 12.    EditCopy ()             //Copies the client's email address to 
> the clipboard.
> 13.    SelectMode (State: Off!)
> 14.   
> 15.    v=ClipboardGet     //v now equals the client's email address.
> 16.    vTo=v
> 17.    vSubject="LIA Questionnaire Report of Findings"
> 18.    vBody="Thank you for participating."
> 19.   
> 20.    //Get pdf file name onto the clipboard.
> 21.    PosDocTop ()
> 22.    SearchString (StrgToLookFor: "[[")
> 23.    SearchNext (SearchMode: Extended!)
> 24.    SelectMode (State: Off!)
> 25.    PosLineEnd ()
> 26.    Type (Text: ".pdf")        //Types the extension on the
name.
> 27.    SelectMode (State: On!)
> 28.    PosLineBeg ()
> 29.    EditCopy ()        //Copies the PDF file name to the clipboard.
> 30.    CloseNoSave ()    //Closes the file without saving the changes.
> 31.   
> 32.    c=ClipboardGet
> 33.    vPath= "C:\LifeMod\Reports\"
> 34.    vAttachment=vPath+c
> 35.    vPasteWPContents=False
> 36.    vSendNow=True
> 37.   
> 38.    TBEmail(vTo; vSubject; vBody; vAttachment; vSendNow)
> 39.    Quit ()
> 40.    /////////////////////////////////////////////////////
> 41.   
> 42.    Procedure TBEmail(vTo; vSubject; vBody; vAttachment; vSendNow)
> 43.        tbEXE="C:\Program Files\Mozilla
Thunderbird\thunderbird.exe"
> 44.   
> 45.        args=" -compose "
> 46.        to="to='"+vTo+"'"
> 47.        subject="subject="+vSubject
> 48.        attachment="attachment="+vAttachment
> 49.        body="body="+vBody
> 50.       
tb=tbEXE+args+to+","+subject+","+attachment+","+bo
dy
> 51.   
> 52.        DllCall ProtoType
> 53. 
>
WinExec("kernel32.dll";"WinExec";DWord!;{AnsiString(lpCmdLin
e);nCmdShow})
> 54.        WinExec(tb; 0)
> 55.   
> 56.        InhibitInput(Off!)
> 57.        Display(On!)   
> 58.   
> 59.    If (vSendNow=True)
> 60.            Repeat
> 61.                Wait(1)
> 62.            Until(Applocate("Compose: "+vSubject)<>0)
> 63.        EndIf
> 64.   
> 65.   
> 66.        //Check that each file exists if attached
> 67.        If (vAttachment<>"")
> 68.            ForEach (x; StrParseList(vAttachment; ","))
> 69.                If (NOT(DoesFileExist(x)))
> 70.                    MessageBox(;"File Does Not
Exist";x;IconStop!)
> 71.                    Quit()
> 72.                EndIf
> 73.            EndFor
> 74.        EndIf
> 75.   
> 76.        If (vSendNow=True)
> 77.            SendKeys("{Ctrl+Enter}")
> 78.        EndIf
> 79.    EndProc
> 80.   
> 
> 
> 
> Vic
> 
> 
> 
> 
> Kenneth Hobson wrote:
>>
>> You need to check vAttachment.
>>
>> Prior to sending keys:
>>
>>     If (vPasteWPDContents=True or vSendNow=True)
>>         Repeat
>>             Wait(1)
>>         Until(Applocate("Compose: "+vSubject)<>0)
>>     EndIf
>>
>> I added the routine above and this to the TBEmail() wpu Code Snippet 
>> to address a missing file(s) and focus issues:
>>
>>     //Check that each file exists if attached
>>     If (vAttachment<>"")
>>         ForEach (x; StrParseList(vAttachment; ","))
>>             If (NOT(DoesFileExist(x)))
>>                 MessageBox(;"File Does Not
Exist";x;IconStop!)
>>                 Quit()
>>             EndIf
>>         EndFor
>>     EndIf
>>
>>
>>
> 
Post Reply
<< Previous 1 2 3 4 Next >>
( Page 1 of 4 )
about | contact