Jump to content
Macro Express Forums

Variable in command line string?


randallf

Recommended Posts

Hello all,

 

I want to launch an outlook email from a command line like:

 

outlook.exe /c ipm.note /m randall&subject=help%20with%%20everything&body=The%20following%20is%20happy%20fun%20tiem:

 

And this works, but I want to use a variable in that ASCII string...

 

/c ipm.note /m randall&subject=help%20with%%20everything&body=The%20following%20is%20happy%20fun%20tiem:%T20%

 

and use multiple lines, etc, I found a converter for the string but is it possible to insert variables in here? Will it work if I use the ascii for %, etc? EDIT: I tried that, it just inserts %T20% into the email.... %25T20%25 for the record

 

What's the fastest way to craft a new email without a template or issuing text type that the community knows? Is there a way to force it to parse?

OutlookTest.mex

Link to comment
Share on other sites

I hope you're not using this to send spam. :unsure:

 

I got this to work. Put this into T20 using the Variable Set String command:

 

/c ipm.note /m randall&subject=help%20with%%20everything&body=The%20following%20is%20happy%20fun%20tiem:

 

Then put 'outlook.exe' in the Program Path/Name field of the Program Launch: command and %T20% in the Program Parameters field.

Link to comment
Share on other sites

I hope you're not using this to send spam. :unsure:

 

I got this to work. Put this into T20 using the Variable Set String command:

 

/c ipm.note /m randall&subject=help%20with%%20everything&body=The%20following%20is%20happy%20fun%20tiem:

 

Then put 'outlook.exe' in the Program Path/Name field of the Program Launch: command and %T20% in the Program Parameters field.

 

NEVER!!! Well, some people see it that way, but the end-result of my work on this team is a phone call or email, it's a high-paperwork environment and any way that I can speed it up is good. THANKS for the input, I'll give it a try!

 

Brilliant, BTW, should have seen this

Link to comment
Share on other sites

oh, hrm, was this the answer I wanted? You can just directly put /c ipm.note /m randall&subject=etc into the command line section of the dialogue and it works fine, the problem is I want to do like

 

/c ipm.note /m randall&subject=%T20%

 

And have it parse %T20% to the mex variable and not just display the ascii string...

 

I tried doing like

Variable set string T98 Whatever Subject

Variable set string T99 /c ipm.note /m randall&subject=%25T98%25

 

I then put T99 in the command line field of the macro command but I just get the same output of %T98% in that place instead of the parsed variable

 

I need to get the variables to parse from ME before they are input into the email... am I missing something basic here?

 

I have an email that has like 12+ fields in it that the first part of the macro pulls from a ticketing system, I then need to send someone an email with those bits of information and headers like Case number: %T23% End user: %T44% etc and it would be WAY faster if I could just command line it up by building a custom command line each time, I just can't see how it's possible

 

The way I have been doing it is to launch a blank email and then populate it but that is much, much more difficult and WAAAAY slower

 

 

You can see more on this here: http://support.microsoft.com/kb/287573

Link to comment
Share on other sites

I'm not quite sure what is going wrong with your macro. Attached is a copy of my test macro. It should be a good starting point.

 

Exactly, but inside that first 'variable set string' I want to use more variables like %T45% or whatever... It doesn't seem to parse them first, it just outputs that string directly, but I was wondering if there's a way around that...

 

Variable Set String %T20% "/c ipm.note /m Kevin%20Heaton&subject=help%20with%20everything&body=The%20following%20is%20happy%20fun%20time:%T20%" (or whatever T20 is in unicode)

Link to comment
Share on other sites

That works too.

OutlookTest__2.mex

 

It sure does! I must have been fumbling the nesting of everything, (yes in fact I was messing up the set string > set string > use variable combo) thanks a ton this is going to be really great!

 

I have tried literally five different ways of populating emails in ME and this is by far and away the quickest.

Link to comment
Share on other sites

can't for the life of me figure out what the difference is here

 

These two lines are topologically very similar yet the 'test' one works and the real one doesn't. Stumped.

 

<TVAR2:42:01:test%0dtest%T1%test%0dtest%T1%test%0dtest%T1%test%0dtest%T1%test%0dtest%T1%test%0dtest%T1%test%0dtest%T1%test%0dtest%T1%test%0dtest%T1%test%0dtest%T1%test%0dtest%T1%test%0dtest%T1%test%0dtest%T1%test%0dtest%T1%test%0dtest%T1%test%0dtest%T1%test%0dtest%T1%>

 

<TVAR2:42:01:Clarify%20Number:%20%25T1%25Trio%20Number:%20%25T15%25Case%20Title:%20%25T11%25%0dContact%20Name:%20%25T9%25%20%25T10%25%0dContact%20Phone%20Number:%20%25T20%25%0dContact%20Location:%20%25T19%25%0dPriority:%20U%25T91%25%0dCreate%20Date/Time:%20%25T97%25>

Link to comment
Share on other sites

It seems to work for some things and not others,

 

specifically, for this macro

<TVAR2:40:01:Kevin%20Heaton><TVAR2:41:01:help%20with%20everything><TVAR2:42:01:Clarify%20Number:%20%25T1%25Trio%20Number:%20%25T15%25Case%20Title:%20%25T11%25%0dContact%20Name:%20%25T9%25%20%25T10%25%0dContact%20Phone%20Number:%20%25T20%25%0dContact%20Location:%20%25T19%25%0dPriority:%20U%25T91%25%0dCreate%20Date/Time:%20%25T97%25><REM2:><TVAR2:20:01:/c ipm.note /m %T40%&subject=%T41%&body=%T42%><TBOX4:T:1:CenterCenter000805000223:000:DEBUG T20%T20%><LAUNCHDEL2:0:01outlook.exe<PARAM>%T20%>

 

I get this debug

 

/c ipm.note /m Kevin%20Heaton&subject=help%20with%20everything&body=Clarify%20Number:%20%25T1%25Trio%20Number:%20%25T15%25Case%20Title:%20%25T11%25%0dContact%20Name:%20%25T9%25%20%25T10%25%0dContact%20Phone%20Number:%20%25T20%25%0dContact%20Location:%20%25T19%25%0dPriority:%20U%25T91%25%0dCreate%20Date/Time:%20%25T97%25

 

and this output (the formatting will change later not worried about it atm)

 

Clarify Number: %T1%Trio Number: %T15%Case Title: %T11%

Contact Name: %T9% %T10%

Contact Phone Number: %T20%

Contact Location: %T19%

Priority: U%T91%

Create Date/Time: %T97%

 

 

When I tried the stuff in the above comment for a test it worked fine, I am stumped.

 

The only thing I can imagine is that it has a 255 character limit for parsing or something, though that doesnt fit with other tests that ive done. It's 337 characters.

Link to comment
Share on other sites

  • 8 months later...

I've actually found this so incredibly handy. I've been creating mail templates for loads of things. So, thanks guys!

 

One question though. When I'm running the command line, I'm managing to create a new mail with a recipient, subject and body. But I'm wondering, is there any way to add in a cc, or extra recipients?

 

Thanks in advance!

Link to comment
Share on other sites

I've actually found this so incredibly handy. I've been creating mail templates for loads of things. So, thanks guys!

 

One question though. When I'm running the command line, I'm managing to create a new mail with a recipient, subject and body. But I'm wondering, is there any way to add in a cc, or extra recipients?

 

Thanks in advance!

 

I should say, I know how to put in multiple recipients, but it’s just cc’ing someone that’s got me a bit lost.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...