This might be something dutch, but there where no standard solutions on this one yet on the internet.
the problem was in word (when mailmerging a database) we have a currency field.
This field will be filled with an ammount (ex. 10.00, 125.25 or 50.50)
What we wanted to do is make the decimals dissapear for .00 and replace it with ,- and for .25 it would be ,25.
So i tried to do this and it worked with an IF field:
{ IF { MERGEFIELD CURRENCY } ="{ MERGEFIELD CURRENCY \# 0 }" "{ MERGEFIELD "CURRENCY" },-""{ MERGEFIELD CURRENCY \# 0,00 }" }
Might come in handy sometime.
7 Apr 2011
DDE link to access or excel not working for DOCX (word 2007)
Hi everyone,
Microsoft did it again.
We tried to use DDE link to ACCESS from WORD (2007) and everything was working fine when you use it the first time. but after saving the documents the document gives an error message: "Word could not re-establish the DDE connection to Microsoft Access to complete the current task".
This was for a project that was allready in production, so no time to waste. After a lot of research with my good friend Google I found out that there are a lot of problems with DDE but i could not find a solution for my problem.
I tried everything including using older versions of word, but therefore i needed to save the documents to .doc instead of .docx and it worked in the older versions.
So we tried the .doc documents in word 2007 and it worked.
Please microsoft next time update error messages.
Problem:
With a .docx document trying to DDE link to an Acces or Excel file i get the error "Word could not re-establish the DDE connection to Microsoft Access to complete the current task".
Solution:
Save the document as .doc
Microsoft did it again.
We tried to use DDE link to ACCESS from WORD (2007) and everything was working fine when you use it the first time. but after saving the documents the document gives an error message: "Word could not re-establish the DDE connection to Microsoft Access to complete the current task".
This was for a project that was allready in production, so no time to waste. After a lot of research with my good friend Google I found out that there are a lot of problems with DDE but i could not find a solution for my problem.
I tried everything including using older versions of word, but therefore i needed to save the documents to .doc instead of .docx and it worked in the older versions.
So we tried the .doc documents in word 2007 and it worked.
Please microsoft next time update error messages.
Problem:
With a .docx document trying to DDE link to an Acces or Excel file i get the error "Word could not re-establish the DDE connection to Microsoft Access to complete the current task".
Solution:
Save the document as .doc
22 Apr 2010
exec() in PHP (unable to fork error)
Dealing with webapplications that can actually run programs in the background you will run into the exec() command in php very easily. Running commands like this on a windows server is a bit tricky as you want to be as secure as you can.
I'm going to explain a bit how we got it as secure as possible.
First of all we use IIS.
Create a subdomain for IIS and only give it rights to a subdirectory with the executable you would like to run with the php script (make sure the php script is also in the same directory.
After that give it security rights with a newly created user, creating a user is very straight forward. as long as you start the lusrmgr.msc command.
When the user is created give it read and execute rights on the executable you wish to run. and what is easily overseen give it read and execute rights at cmd.exe.When the user has no right to cmd.exe you will get the error:
It's simple as that.
Now you can run the script by calling http:\\subdomain.domain.com\script.php and everything should work for you now.
I'm going to explain a bit how we got it as secure as possible.
First of all we use IIS.
Create a subdomain for IIS and only give it rights to a subdirectory with the executable you would like to run with the php script (make sure the php script is also in the same directory.
After that give it security rights with a newly created user, creating a user is very straight forward. as long as you start the lusrmgr.msc command.
When the user is created give it read and execute rights on the executable you wish to run. and what is easily overseen give it read and execute rights at cmd.exe.When the user has no right to cmd.exe you will get the error:
Unable to fork [executable.exe] in C:\Inetpub\wwwroot\subdomain\script.php
It's simple as that.
Now you can run the script by calling http:\\subdomain.domain.com\script.php and everything should work for you now.
23 Feb 2010
How To Make a Custom Google Buzz Button 1.4
Quote from Noonski.nl:
I was looking for a ready made Google Buzz Button that would dynamicly generate the correct information to post to Google Buzz through Google Reader. There where a few but they either required using a service or a hand made link. I needed a button that would stay dynamic on all pages made from the main template page. So off course i had to dust of the old Javascript brain cells and make one myself. It's pretty easy and basic.
Eventually i needed some good help from scinor with the extra scripting.
Updated on 23.02.2010 to Version 1.4
- Added detection of Emtpy Meta Description, Some Bloggers Don't Learn ;).
Updated on 23.02.2010 to Version 1.3
- Image is not pulled from Google Servers anymore, but uses a 16x16 blob.
- Button now also grabs description to post to Google Reader/Buzz.
-Script parses and replaces single quotes ' with ' from the desciption.
Updated Version 1.1
- does not need you to change anything to the script, it uses Google's own Buzz Graphic.
CODE: download here
I was looking for a ready made Google Buzz Button that would dynamicly generate the correct information to post to Google Buzz through Google Reader. There where a few but they either required using a service or a hand made link. I needed a button that would stay dynamic on all pages made from the main template page. So off course i had to dust of the old Javascript brain cells and make one myself. It's pretty easy and basic.
Eventually i needed some good help from scinor with the extra scripting.
Updated on 23.02.2010 to Version 1.4
- Added detection of Emtpy Meta Description, Some Bloggers Don't Learn ;).
Updated on 23.02.2010 to Version 1.3
- Image is not pulled from Google Servers anymore, but uses a 16x16 blob.
- Button now also grabs description to post to Google Reader/Buzz.
-Script parses and replaces single quotes ' with ' from the desciption.
Updated Version 1.1
- does not need you to change anything to the script, it uses Google's own Buzz Graphic.
CODE: download here
15 Feb 2010
How To Make a Custom Google Buzz Button version 1.1
Version 1.3 available here
Revision of the previous post on scinor.blogspot.com that can be found here but cannot be used anymore!
This is the version that can be used. I worked together with Noonski for this update. So credits to www.noonski.nl. The code to paste on your blog/page:
How To Make a Custom Google Buzz Button by Noonski
Today not a message from me but from a friend of mine Noonski (A big name in the windows mobile developers community) about google buzz buttons:
Version 1.3 available click here
Full message can be found here: http://blog.noonski.nl/2010/20100214-Custom_Google_Buzz_Button.html
I was looking for a ready made Google Buzz Button that would dynamicly generate the correct information to post to Google Buzz through Google Reader. There where a few but they either required using a service or a hand made link. I needed a button that would stay dynamic on all pages made from the main template page. So off course i had to dust of the old Javascript brain cells and make one myself. It's pretty easy and basic.
You need to edit the image source to one on your own domain
(Leechers will be shot in the Head, I'm not a millionaire)
And you will need to Edit the variablesbelow:
srcUrl=http://www.MyDomain.com
&
srcTitle=My+Domain+Title
Be sure to use the Plus + in the srcTitle Variable instead of spaces.
11 Feb 2010
Get files from FTP and mail them "batch" and VBS
The "why" of this script is not to be explained this time unfortunately. besides that i lost the website I got all the pieces of code from, but I did not want to keep this from the public to know.
What does this script do?
1.This script gets particular files from an FTP account.
2.It puts them in an directory locally
3.It mails them to multiple addresses
4.It deletes the files form the FTP account.
5.It creates an log file.
Please feel free to copy.
What does this script do?
1.This script gets particular files from an FTP account.
2.It puts them in an directory locally
3.It mails them to multiple addresses
4.It deletes the files form the FTP account.
5.It creates an log file.
Please feel free to copy.
::@echo off
SET SERVER=ftp5.****.nl
SET USERNAME=*****
SET PASSWORD=*****
SET LOCALFILE=C:\New
SET REMOTEPATH=/bin/ls
SET REMOTEFILE=omzet_*.xls
SET LOGFILE=c:\FTP\ftplog.txt
SET TEMPFILE=$temp.txt
cd %LOCALFILE%
echo open %SERVER% >%TEMPFILE%
echo %USERNAME%>>%TEMPFILE%
echo %PASSWORD%>>%TEMPFILE%
echo bin >>%TEMPFILE%
echo cd %REMOTEPATH% >>%TEMPFILE%
echo prompt >>%TEMPFILE%
echo mget %REMOTEFILE% >>%TEMPFILE%
echo mdelete %REMOTEFILE% >>%TEMPFILE%
echo quit >>%TEMPFILE%
echo. >>%LOGFILE%
echo. >>%LOGFILE%
echo Transfering %REMOTEFILE% to %LOCALFILE% at %DATE% %TIME% >>%LOGFILE%
REM Execute FTP script
REM ------------------
ftp -s:%TEMPFILE% >>%LOGFILE%
REM Clean up
REM --------
del %TEMPFILE%
c:\ftp\mail.vbs
echo Mail send >>%LOGFILE%
for /F "tokens=2-4 delims=/- " %%A in ('date/T') do set var=%%A%%B%%C
md "c:\NEw\%var%"
move c:\NEW\*.* C:\NEW\%var%
:: DONE
echo files archived >>%LOGFILE%
mail.vbs:
'Email the files
strFolder = "C:\NEW"
strFileExt = "xls"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strFolder)
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Omzet bestanden van vandaag!"
objMessage.From = "*******"
objMessage.To = "*******; *******"
objMessage.TextBody = "Hi Everyone, this is the message."
For Each objFile In objFolder.Files
strFileExt = objFSO.GetExtensionName(objFile.Path)
objMessage.AddAttachment objFile.Path
Next
'Configuration Info
objMessage.Configuration.Fields.Item _
("http://schemas.Microsoft.Com/cdo/configuration/smtpauthenticate") = 1
objMessage.Configuration.Fields.Item _
("http://schemas.Microsoft.Com/cdo/configuration/sendusername") = "*****"
objMessage.Configuration.Fields.Item _
("http://schemas.Microsoft.Com/cdo/configuration/sendpassword") = "*****"
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.****.com"
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objMessage.Send
Subscribe to:
Posts (Atom)