View Single Post
  #1 (permalink)  
Old 06-28-2009, 10:03 PM
NinjaDuck's Avatar
NinjaDuck
VIP Duck
Offline
Location: Omnipresent
 
Join Date: Feb 2009
Posts: 825
Reputation: 6270
NinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the communityNinjaDuck is a trusted member of the community
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
SOLVED: Anyone have a script for changing the outlook signature?

Ok. Periodically I research this and still never find an answer. Everytime you flash your phone, outlook reverts back to the "Sent from Windows Mobile" default sig.

Has anyone figured out how to edit this with script?

Just figured I would try. This has to be bugging many of you as well. I hope it is not stored in PIM.VOL. I do not see anything in the Pocket Outlook Object Model (POOM) documentation: http://msdn.microsoft.com/en-us/library/aa914277.aspx



Never Mind:


I found the code on the windows mobile team blog:

http://blogs.msdn.com/windowsmobile/...-accounts.aspx


#include <atlbase.h>
#include <cemapi.h>

HRESULT AddSignatureToAccount()
{
HRESULT hr;

CComPtr<IMAPITable> ptbl;
CComPtr<IMAPISession> pSession;
CComPtr<IMsgStore> pMsgStore;

// Log onto MAPI
hr = MAPILogonEx(0, NULL, NULL, 0, static_cast<LPMAPISESSION *>(&pSession));

// You can open a different message store here instead of the default
hr = pSession->OpenMsgStore(NULL, 0, NULL, NULL, 0, &pMsgStore);

SPropValue rgspv[3] = { 0 };

rgspv[0].ulPropTag = PR_CE_SIGNATURE; // signature content
rgspv[0].Value.lpszW = L"Sent from my personal Windows Mobile phone";

rgspv[1].ulPropTag = PR_CE_USE_SIGNATURE; // use the signature in newly composed emails
rgspv[1].Value.b = TRUE;

rgspv[2].ulPropTag = PR_CE_USE_SIGNATURE_REPLY_FORWARD; // use signature in replied or forwarded emails
rgspv[2].Value.b = TRUE;

// save the data the properties
hr = pMsgStore->SetProps (3, rgspv, NULL);

// Log off
pSession->Logoff(0, 0, 0);

return hr;
}

Last edited by NinjaDuck; 06-28-2009 at 10:58 PM. Reason: SOLVED
Reply With Quote
This post has been thanked 1 times.