Convert HTML to String

Does anybody know of a way to quickly convert HTML to a string? I'm 
running into characters like ( =2E ) that I would like translated to the 
ASCII value, in this case ( . ) a period.

Here's an example string I'd like to translate:
=0D=0A   <img border=3D"0" width=3D"739" height=3D"71" nosend=3D"1"=

My method below seems kind of crude. Is there an easier way?

Here's what I've gotten so far:

findString = "=";

while ( startPos > 0 )
{
   startPos = strBody.Find( findString );
   if ( startPos > 0 )
   {
      // Get the next two characters
      CString nextTwo = strBody.Mid( startPos + 1, 2 );

      // Translate this into the ASCII equivalent?
	????

      // Remove the characters translated
	strBody.Delete( startPos, 3 );

      // Insert the translated character back into the string
      strBody.Insert( startPos, _T(newChar) );

   }
}

Thanks for any help on this.
0
dmetcalf (24)
12/19/2007 2:40:12 AM
vc.mfc 33608 articles. 0 followers. Follow

11 Replies
1137 Views

Similar Articles

[PageSpeed] 41

"billyard" <dmetcalf@columbus.rr.com> wrote in message 
news:47688467$0$16093$4c368faf@roadrunner.com...
> Does anybody know of a way to quickly convert HTML to a string? I'm 
> running into characters like ( =2E ) that I would like translated to the 
> ASCII value, in this case ( . ) a period.
>
> Here's an example string I'd like to translate:
> =0D=0A   <img border=3D"0" width=3D"739" height=3D"71" nosend=3D"1"=
>

Try either CoInternetParseUrl() or UrlCanonicalize().  The doc for these 
API's references other API's.  I think you need to decode the url so look 
for the flags that handle that.

-- David



0
dc2983 (3206)
12/19/2007 2:53:19 AM
"billyard" <dmetcalf@columbus.rr.com> ha scritto nel messaggio 
news:47688467$0$16093$4c368faf@roadrunner.com...

>      // Get the next two characters
>      CString nextTwo = strBody.Mid( startPos + 1, 2 );
>
>      // Translate this into the ASCII equivalent?
> ????

So, is your problem to translate a string of kind "XX" where XX is an hex 
integer (e.g. "2D") into the corresponding ASCII character?

If so, I would use a code like this (may have errors... not tested on a 
compiler, I just wrote this on the keyboard and read it again):

The main function is this:

  TCHAR AsciiHexToChar(LPCTSTR asciiHexCode)

it converts from the given hex ASCII code string to corresponding ASCII 
character, e.g.:

  AsciiHexToChar( _T("2E") ) returns _T('.')

....if you find the _T() confusing, imagine like this:

  AsciiHexToChar( "2E" ) returns '.'

So, in your loop, you could write:

  TCHAR ch = AsciiHexToChar( nextTwo );

and ch stores the desidered character.

<code>
// Converts a character storing an hex nibble
// ('0'-'9','a'-'f','A'-'F')
// into its decimal value.
int HexNibbleToInt( TCHAR hexNibble )
{
    if ( hexNibble >= _T('0') && hexNibble <= _T('9') )
        return (hexNibble - _T('0'));
    else if ( hexNibble >= _T('A') && hexNibble <= _T('F') )
        return (hexNibble - _T('A')) + 10;
    else if ( hexNibble >= _T('a') && hexNibble <= _T('f') )
        return (hexNibble - _T('a')) + 10;
    else
    {
        // *** ERROR - invalid character
        ASSERT( FALSE );
        return -1;
    }
}


// Converts ASCII 2-characters hex codes to a single character,
// e.g. "2E" --> '.'
// On bad characters, returns '\0'
TCHAR AsciiHexToChar(LPCTSTR asciiHexCode)
{
    int lowNibble;
    int highNibble;
    int asciiCode;

    // Check pointer
    ASSERT( asciiHexCode != NULL );

    // Check that the strings has two characters
    ASSERT( asciiHexCode[0] != _T('\0') );
    ASSERT( asciiHexCode[1] != _T('\0') );
    ASSERT( asciiHexCode[2] == _T('\0') );


    // High nibble
    highNibble = HexNibbleToInt( asciiHexCode[0] ) * 16;
    if ( highNibble < 0 )
        return '\0'; // bad nibble

    // Low nibble
    lowNibble = HexNibbleToInt( asciiHexCode[1] );
    if ( lowNibble < 0 )
        return '\0'; // bad nibble

    // Convert to character using ASCII
    asciiCode = highNibble * 16 + lowNibble;

    return (TCHAR)asciiCode;
}

</code>


Giovanni


0
12/19/2007 10:15:52 AM
"Giovanni Dicanio" <giovanni.dicanio@invalid.com> ha scritto nel messaggio 
news:uFLjjgiQIHA.536@TK2MSFTNGP06.phx.gbl...
>
> "billyard" <dmetcalf@columbus.rr.com> ha scritto nel messaggio 
> news:47688467$0$16093$4c368faf@roadrunner.com...
>
>>      // Get the next two characters
>>      CString nextTwo = strBody.Mid( startPos + 1, 2 );
>>
>>      // Translate this into the ASCII equivalent?
>> ????
>
> So, is your problem to translate a string of kind "XX" where XX is an hex 
> integer (e.g. "2D") into the corresponding ASCII character?

Another option could be to use sscanf (or the TCHAR-aware _stscanf), or the 
more secure _stscanf_l .

http://msdn2.microsoft.com/en-us/library/zkx076cy(VS.80).aspx

x and X should be the type specifiers for hexadecimal integers, IIRC.

Giovanni





0
12/19/2007 10:29:11 AM
Giovanni Dicanio wrote:
> "billyard" <dmetcalf@columbus.rr.com> ha scritto nel messaggio 
> news:47688467$0$16093$4c368faf@roadrunner.com...
> 
>>      // Get the next two characters
>>      CString nextTwo = strBody.Mid( startPos + 1, 2 );
>>
>>      // Translate this into the ASCII equivalent?
>> ????
> 
> So, is your problem to translate a string of kind "XX" where XX is an hex 
> integer (e.g. "2D") into the corresponding ASCII character?
> 
> If so, I would use a code like this (may have errors... not tested on a 
> compiler, I just wrote this on the keyboard and read it again):
> 
> The main function is this:
> 
>   TCHAR AsciiHexToChar(LPCTSTR asciiHexCode)
> 
> it converts from the given hex ASCII code string to corresponding ASCII 
> character, e.g.:
> 
>   AsciiHexToChar( _T("2E") ) returns _T('.')
> 
> ...if you find the _T() confusing, imagine like this:
> 
>   AsciiHexToChar( "2E" ) returns '.'
> 
> So, in your loop, you could write:
> 
>   TCHAR ch = AsciiHexToChar( nextTwo );
> 
> and ch stores the desidered character.
> 
> <code>
> // Converts a character storing an hex nibble
> // ('0'-'9','a'-'f','A'-'F')
> // into its decimal value.
> int HexNibbleToInt( TCHAR hexNibble )
> {
>     if ( hexNibble >= _T('0') && hexNibble <= _T('9') )
>         return (hexNibble - _T('0'));
>     else if ( hexNibble >= _T('A') && hexNibble <= _T('F') )
>         return (hexNibble - _T('A')) + 10;
>     else if ( hexNibble >= _T('a') && hexNibble <= _T('f') )
>         return (hexNibble - _T('a')) + 10;
>     else
>     {
>         // *** ERROR - invalid character
>         ASSERT( FALSE );
>         return -1;
>     }
> }
> 
> 
> // Converts ASCII 2-characters hex codes to a single character,
> // e.g. "2E" --> '.'
> // On bad characters, returns '\0'
> TCHAR AsciiHexToChar(LPCTSTR asciiHexCode)
> {
>     int lowNibble;
>     int highNibble;
>     int asciiCode;
> 
>     // Check pointer
>     ASSERT( asciiHexCode != NULL );
> 
>     // Check that the strings has two characters
>     ASSERT( asciiHexCode[0] != _T('\0') );
>     ASSERT( asciiHexCode[1] != _T('\0') );
>     ASSERT( asciiHexCode[2] == _T('\0') );
> 
> 
>     // High nibble
>     highNibble = HexNibbleToInt( asciiHexCode[0] ) * 16;
>     if ( highNibble < 0 )
>         return '\0'; // bad nibble
> 
>     // Low nibble
>     lowNibble = HexNibbleToInt( asciiHexCode[1] );
>     if ( lowNibble < 0 )
>         return '\0'; // bad nibble
> 
>     // Convert to character using ASCII
>     asciiCode = highNibble * 16 + lowNibble;
> 
>     return (TCHAR)asciiCode;
> }
> 
> </code>
> 
> 
> Giovanni
> 
> 
That's exactly what I want to do! Thank you so much.

Also, today I found a class called HttpUtility that looks like it does 
all the work for me. I haven't tried it yet, but I'll let you all know 
how it works for me. If not, I like Giovanni's answer. The other 
solution doesn't seem to fit my problem.

Thanks all for the suggestions.
0
dmetcalf (24)
12/20/2007 1:06:44 AM
Giovanni Dicanio wrote:
> "billyard" <dmetcalf@columbus.rr.com> ha scritto nel messaggio 
> news:47688467$0$16093$4c368faf@roadrunner.com...
> 
>>      // Get the next two characters
>>      CString nextTwo = strBody.Mid( startPos + 1, 2 );
>>
>>      // Translate this into the ASCII equivalent?
>> ????
> 
> So, is your problem to translate a string of kind "XX" where XX is an hex 
> integer (e.g. "2D") into the corresponding ASCII character?
> 
> If so, I would use a code like this (may have errors... not tested on a 
> compiler, I just wrote this on the keyboard and read it again):
> 
> The main function is this:
> 
>   TCHAR AsciiHexToChar(LPCTSTR asciiHexCode)
> 
> it converts from the given hex ASCII code string to corresponding ASCII 
> character, e.g.:
> 
>   AsciiHexToChar( _T("2E") ) returns _T('.')
> 
> ...if you find the _T() confusing, imagine like this:
> 
>   AsciiHexToChar( "2E" ) returns '.'
> 
> So, in your loop, you could write:
> 
>   TCHAR ch = AsciiHexToChar( nextTwo );
> 
> and ch stores the desidered character.
> 
> <code>
> // Converts a character storing an hex nibble
> // ('0'-'9','a'-'f','A'-'F')
> // into its decimal value.
> int HexNibbleToInt( TCHAR hexNibble )
> {
>     if ( hexNibble >= _T('0') && hexNibble <= _T('9') )
>         return (hexNibble - _T('0'));
>     else if ( hexNibble >= _T('A') && hexNibble <= _T('F') )
>         return (hexNibble - _T('A')) + 10;
>     else if ( hexNibble >= _T('a') && hexNibble <= _T('f') )
>         return (hexNibble - _T('a')) + 10;
>     else
>     {
>         // *** ERROR - invalid character
>         ASSERT( FALSE );
>         return -1;
>     }
> }
> 
> 
> // Converts ASCII 2-characters hex codes to a single character,
> // e.g. "2E" --> '.'
> // On bad characters, returns '\0'
> TCHAR AsciiHexToChar(LPCTSTR asciiHexCode)
> {
>     int lowNibble;
>     int highNibble;
>     int asciiCode;
> 
>     // Check pointer
>     ASSERT( asciiHexCode != NULL );
> 
>     // Check that the strings has two characters
>     ASSERT( asciiHexCode[0] != _T('\0') );
>     ASSERT( asciiHexCode[1] != _T('\0') );
>     ASSERT( asciiHexCode[2] == _T('\0') );
> 
> 
>     // High nibble
>     highNibble = HexNibbleToInt( asciiHexCode[0] ) * 16;
>     if ( highNibble < 0 )
>         return '\0'; // bad nibble
> 
>     // Low nibble
>     lowNibble = HexNibbleToInt( asciiHexCode[1] );
>     if ( lowNibble < 0 )
>         return '\0'; // bad nibble
> 
>     // Convert to character using ASCII
>     asciiCode = highNibble * 16 + lowNibble;
> 
>     return (TCHAR)asciiCode;
> }
> 
> </code>
> 
> 
> Giovanni
> 
> 
That's exactly what I want to do! Thank you so much.

Also, today I found a .NET class called HttpUtility that looks like it 
does all the work for me. I haven't tried it yet, but I'll let you all 
know how it works for me. If not, I like Giovanni's answer. The other 
solution doesn't seem to fit my problem.

Thanks all for the suggestions.
0
dmetcalf (24)
12/20/2007 1:07:59 AM
billyard wrote:
> Giovanni Dicanio wrote:
>> "billyard" <dmetcalf@columbus.rr.com> ha scritto nel messaggio 
>> news:47688467$0$16093$4c368faf@roadrunner.com...
>>
>>>      // Get the next two characters
>>>      CString nextTwo = strBody.Mid( startPos + 1, 2 );
>>>
>>>      // Translate this into the ASCII equivalent?
>>> ????
>>
>> So, is your problem to translate a string of kind "XX" where XX is an 
>> hex integer (e.g. "2D") into the corresponding ASCII character?
>>
>> If so, I would use a code like this (may have errors... not tested on 
>> a compiler, I just wrote this on the keyboard and read it again):
>>
>> The main function is this:
>>
>>   TCHAR AsciiHexToChar(LPCTSTR asciiHexCode)
>>
>> it converts from the given hex ASCII code string to corresponding 
>> ASCII character, e.g.:
>>
>>   AsciiHexToChar( _T("2E") ) returns _T('.')
>>
>> ...if you find the _T() confusing, imagine like this:
>>
>>   AsciiHexToChar( "2E" ) returns '.'
>>
>> So, in your loop, you could write:
>>
>>   TCHAR ch = AsciiHexToChar( nextTwo );
>>
>> and ch stores the desidered character.
>>
>> <code>
>> // Converts a character storing an hex nibble
>> // ('0'-'9','a'-'f','A'-'F')
>> // into its decimal value.
>> int HexNibbleToInt( TCHAR hexNibble )
>> {
>>     if ( hexNibble >= _T('0') && hexNibble <= _T('9') )
>>         return (hexNibble - _T('0'));
>>     else if ( hexNibble >= _T('A') && hexNibble <= _T('F') )
>>         return (hexNibble - _T('A')) + 10;
>>     else if ( hexNibble >= _T('a') && hexNibble <= _T('f') )
>>         return (hexNibble - _T('a')) + 10;
>>     else
>>     {
>>         // *** ERROR - invalid character
>>         ASSERT( FALSE );
>>         return -1;
>>     }
>> }
>>
>>
>> // Converts ASCII 2-characters hex codes to a single character,
>> // e.g. "2E" --> '.'
>> // On bad characters, returns '\0'
>> TCHAR AsciiHexToChar(LPCTSTR asciiHexCode)
>> {
>>     int lowNibble;
>>     int highNibble;
>>     int asciiCode;
>>
>>     // Check pointer
>>     ASSERT( asciiHexCode != NULL );
>>
>>     // Check that the strings has two characters
>>     ASSERT( asciiHexCode[0] != _T('\0') );
>>     ASSERT( asciiHexCode[1] != _T('\0') );
>>     ASSERT( asciiHexCode[2] == _T('\0') );
>>
>>
>>     // High nibble
>>     highNibble = HexNibbleToInt( asciiHexCode[0] ) * 16;
>>     if ( highNibble < 0 )
>>         return '\0'; // bad nibble
>>
>>     // Low nibble
>>     lowNibble = HexNibbleToInt( asciiHexCode[1] );
>>     if ( lowNibble < 0 )
>>         return '\0'; // bad nibble
>>
>>     // Convert to character using ASCII
>>     asciiCode = highNibble * 16 + lowNibble;
>>
>>     return (TCHAR)asciiCode;
>> }
>>
>> </code>
>>
>>
>> Giovanni
>>
>>
Giovanni - Nicely done code that works great for me. Only one minor 
problem. In the code above, you multiply highNibble by 16 two times. 
Other than that, it works exactly as you said it would.

This line:

// Convert to character using ASCII
      asciiCode = highNibble * 16 + lowNibble;

Should read:
      asciiCode = highNibble + lowNibble;

btw - I'm looking forward to the day I could write code like that and
actually have it compile the first go around!
0
dmetcalf (24)
12/20/2007 2:57:32 AM
I'd avoid sscanf and all its brethren; they have the notable feature that if the text is
not hex, they just give 0, so you get no error checking but you do get an incorrect
result.  Better to do your own parsing so you can have some control of what is going on.
					joe

On Wed, 19 Dec 2007 11:29:11 +0100, "Giovanni Dicanio" <giovanni.dicanio@invalid.com>
wrote:

>
>"Giovanni Dicanio" <giovanni.dicanio@invalid.com> ha scritto nel messaggio 
>news:uFLjjgiQIHA.536@TK2MSFTNGP06.phx.gbl...
>>
>> "billyard" <dmetcalf@columbus.rr.com> ha scritto nel messaggio 
>> news:47688467$0$16093$4c368faf@roadrunner.com...
>>
>>>      // Get the next two characters
>>>      CString nextTwo = strBody.Mid( startPos + 1, 2 );
>>>
>>>      // Translate this into the ASCII equivalent?
>>> ????
>>
>> So, is your problem to translate a string of kind "XX" where XX is an hex 
>> integer (e.g. "2D") into the corresponding ASCII character?
>
>Another option could be to use sscanf (or the TCHAR-aware _stscanf), or the 
>more secure _stscanf_l .
>
>http://msdn2.microsoft.com/en-us/library/zkx076cy(VS.80).aspx
>
>x and X should be the type specifiers for hexadecimal integers, IIRC.
>
>Giovanni
>
>
>
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
12/20/2007 4:37:59 PM
"billyard" <dmetcalf@columbus.rr.com> ha scritto nel messaggio 
news:4769da1a$0$9599$4c368faf@roadrunner.com...

> Giovanni - Nicely done code that works great for me. Only one minor 
> problem. In the code above, you multiply highNibble by 16 two times.

You're right, billyard.
Thanks for your pointing out.

I apologize for my error (as I wrote, I did not compile nor test the code - 
writing code on whiteboard or screen without compiler and debugger can cause 
that :).

> btw - I'm looking forward to the day I could write code like that and
> actually have it compile the first go around!

I believe that that day will come for you: you just need to put passion and 
hard-work in developing code.

G



0
12/21/2007 6:58:12 PM
"billyard" <dmetcalf@columbus.rr.com> ha scritto nel messaggio 
news:4769c073$0$1411$4c368faf@roadrunner.com...

> That's exactly what I want to do! Thank you so much.

You're very wellcome.

(And thanks for pointing out and correcting the bug in my code.)

Giovanni



0
12/21/2007 6:59:29 PM
Hello Group

What I have seen after having tried many things in my life....if you have to 
analyze a string carefully, it makes more sense to go down to the "lowest 
level" instead of using many sophisticated functions.
So I'd do it just like this:

void function(const *char strg) {
  int iPos=0;
  while (strg[iPos]) {
     if (strg[iPos]=='<') {
        ...
     } else if (strg[iPos]=='>') {
        ...
     } else �{
     }
     iPos++;
  }
}

This is quite similar to that I would have done, when I wrote such programs 
in assembly language....To my opinion, these simple program structures still 
show the best performance ;-)

Eunet

"billyard" <dmetcalf@columbus.rr.com> schrieb im Newsbeitrag 
news:47688467$0$16093$4c368faf@roadrunner.com...
> Does anybody know of a way to quickly convert HTML to a string? I'm 
> running into characters like ( =2E ) that I would like translated to the 
> ASCII value, in this case ( . ) a period.
>
> Here's an example string I'd like to translate:
> =0D=0A   <img border=3D"0" width=3D"739" height=3D"71" nosend=3D"1"=
>
> My method below seems kind of crude. Is there an easier way?
>
> Here's what I've gotten so far:
>
> findString = "=";
>
> while ( startPos > 0 )
> {
>   startPos = strBody.Find( findString );
>   if ( startPos > 0 )
>   {
>      // Get the next two characters
>      CString nextTwo = strBody.Mid( startPos + 1, 2 );
>
>      // Translate this into the ASCII equivalent?
> ????
>
>      // Remove the characters translated
> strBody.Delete( startPos, 3 );
>
>      // Insert the translated character back into the string
>      strBody.Insert( startPos, _T(newChar) );
>
>   }
> }
>
> Thanks for any help on this. 


0
1/9/2008 2:39:08 PM
Well, kind of.  other than minor details like char is an obsolete data type that should
not be used in this context, you used "const char *" when you meant LPCTSTR, you are
assuming that every < or > is part of HTML and not actual text (it is nominally incorrect
if they are text, but most browsers will actually handle these cases well), you don't deal
with what might happen if a < or > was found inside a quoted string for an HTML parameter
value, you forgot about handling &-sequences, and you wrote it for 8-bit characters, and
you forgot about UTF-8 encodings (which many Web pages use).  So it will work correctly
for a small percentage of Web pages.  So other than the fact that it misses a whole bunch
of critical conditions, it should work.
				joe

On Wed, 9 Jan 2008 15:39:08 +0100, "Eunet Uhser" <eunet_uhser@hotmail.com> wrote:

>Hello Group
>
>What I have seen after having tried many things in my life....if you have to 
>analyze a string carefully, it makes more sense to go down to the "lowest 
>level" instead of using many sophisticated functions.
>So I'd do it just like this:
>
>void function(const *char strg) {
>  int iPos=0;
>  while (strg[iPos]) {
>     if (strg[iPos]=='<') {
>        ...
>     } else if (strg[iPos]=='>') {
>        ...
>     } else �{
>     }
>     iPos++;
>  }
>}
>
>This is quite similar to that I would have done, when I wrote such programs 
>in assembly language....To my opinion, these simple program structures still 
>show the best performance ;-)
>
>Eunet
>
>"billyard" <dmetcalf@columbus.rr.com> schrieb im Newsbeitrag 
>news:47688467$0$16093$4c368faf@roadrunner.com...
>> Does anybody know of a way to quickly convert HTML to a string? I'm 
>> running into characters like ( =2E ) that I would like translated to the 
>> ASCII value, in this case ( . ) a period.
>>
>> Here's an example string I'd like to translate:
>> =0D=0A   <img border=3D"0" width=3D"739" height=3D"71" nosend=3D"1"=
>>
>> My method below seems kind of crude. Is there an easier way?
>>
>> Here's what I've gotten so far:
>>
>> findString = "=";
>>
>> while ( startPos > 0 )
>> {
>>   startPos = strBody.Find( findString );
>>   if ( startPos > 0 )
>>   {
>>      // Get the next two characters
>>      CString nextTwo = strBody.Mid( startPos + 1, 2 );
>>
>>      // Translate this into the ASCII equivalent?
>> ????
>>
>>      // Remove the characters translated
>> strBody.Delete( startPos, 3 );
>>
>>      // Insert the translated character back into the string
>>      strBody.Insert( startPos, _T(newChar) );
>>
>>   }
>> }
>>
>> Thanks for any help on this. 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
1/9/2008 5:48:59 PM
Reply:

Similar Artilces:

How to convert MKV, AVI, FLV, VOB, WMV, MOD... to iPad on MAC
Now the new iPad is really a much better device to enjoy videos and movies than any previous version of the iPod and iPhone, this should due to its bigger screen and landscape orientation. But many folks encountered lots of problems, the most outstanding issue is the formats can't supported by 'iPad' (http://www.ifunia.com/ipad-column/index.html). As an Apple site editor, after searched and read many articles and reviews, I write out this article on how to convert popular video/audio formats to iPad supported. The following tutorial I will show you how to convert MKV, AV...

Can't create file: *.html outlook 2007
Can't create file: *.html right click the folder you want to create the file in, and then click Properties on the short-cut menu to check your permissions folder i have try this option 1. Use REGEDIT.EXE to locate the following key: HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Sec urity (Note: Depending on your version you may have to modify that path after the "Office" key. You may have folders 8.0, 9.0, 10.0, 11.0, go the highest number. This is probably the version that you use.) 2. Modify the Key "OutlookSecureTempFolder", by replacing "T...

val a string
Hi, z3 = (Mid(z, (InStr(1, z, "(") + 1), Len(z) - (InStr(1, z, "(") + 1))) creates a string, which is 1.96% I want to value it so I changed the formula to z3 = val((Mid(z, (InStr(1, z, "(") + 1), Len(z) - (InStr(1, z, "(") + 1)))) but it does not work Any ideas? Thanks, David Got it. Thanks "David" wrote: > Hi, > > z3 = (Mid(z, (InStr(1, z, "(") + 1), Len(z) - (InStr(1, z, "(") + 1))) > creates a string, which is 1.96% > > I want to value it so I changed the formula to ...

how do I convert a spreadsheet to landscape format?
how do I convert a spreadsheet to landscape format? EXCEL 2007 Page Layout / Page Setup group / Orientation / Landscape If my comments have helped please hit Yes. Thanks. > how do I convert a spreadsheet to landscape format? Copy>Paste Special>Transpose maybe Gord Dibben MS Excel MVP On Mon, 10 May 2010 12:46:01 -0700, mike <mike@discussions.microsoft.com> wrote: >how do I convert a spreadsheet to landscape format? On 5/10/2010 12:46 PM, mike wrote: > how do I convert a spreadsheet to landscape format? The two answers provide sho...

how do I convert an excel file to a flat text file
I need to convert an excel file to a flat text file with no decimals, commas, slashes or dashes Hi, Use File->Save as .. an select TXT file. -- http://blog.jausovec.net "Lannutslp" je napisal: > I need to convert an excel file to a flat text file with no decimals, commas, > slashes or dashes ...

Convert Function to Sub
I have the following function which is used to extract the numeric and alpha characters from a cell. Can someone help me 'convert' this to a sub, so that, for example, with whatever range the user selects, the code will look at each cell and basically remove everything that is not either alpha or numeric? Example: 45 BJ}!12T would be converted to 45BJ12T Public Function ExtractNT(TextString As String) As String Dim x As Long Dim sChar As String ExtractNT = vbNullString For x = 1 To Len(TextString) sChar = Mid(TextString, x, 1) If sCh...

Urgent Help!!! Excel's Marco Auto Convert to Access's db
Hello All. Thank you for reading my post first. I have a excel sheet, it contain the database. And I want to set a Marco Function or VBA etc, which can auto get the data from excel sheet and import into a Access's database. Thank you again. Hi Paul, You really don't need VBA to do this. In Access do file>get external data. Choose Excel as the filetype. (named ranges work best) You can choose to import or link the data. If you link the data the Access db will update whenever the XL sheet is changed. -- John johnf202 at hotmail dot com "Paul Chan" <paul@ram-c...

Need to convert an .OST file to a .PST
How can I convert a user's .ost file into a .pst file? The mailbox has NOT been deleted., if that matters. Thanks! On Fri, 29 Apr 2005 13:18:22 -0500, "bobk" <bkreimborg@netzero.com> wrote: >How can I convert a user's .ost file into a .pst file? The mailbox has NOT >been deleted., if that matters. > >Thanks! > http://officerecovery.com/exchange/ will do it, but if the mailbox is still there is there any reason you can't connect to it and do whatever you need to do on the mailbox? No, there's no reason that I can't connect to the m...

convert number score to letter grade
How can I convert the number scores of my students into letter grade? For example 91-100 is A, 81-90 is B, 71-80 is C etc. Thank you for your advice. "fchoy" <anonymous@discussions.microsoft.com> wrote in message news:7e6401c40329$16c1f950$a401280a@phx.gbl... > How can I convert the number scores of my students into > letter grade? For example 91-100 is A, 81-90 is B, 71-80 > is C etc. Thank you for your advice. Have a look at this thread. via Bob Umlas. From: BobUmlas () Subject: Re: Vlookup also View: Complete Thread (3 articles) Original Format Newsgroups: mi...

Hyper links in a HTML format message do nothing.
When I click on a hyperlink in a HTML format email it does not open IE and take me to the link. When I click on a hyperlink on a plain text format email it works fine, it opens IE and takes me to the website. I have found that if I run IE before I click on the hyperlink on the HTML formated email it works fine. I am running windows 2000 with Office 2000, I have installed all the updates for Windows and Office. Does anyone have any Ideas? Thanks ...

Change default "SaveAs" to *.msg rather than *.html
Hi!, I regularly need to save emails and prefer to save as *.msg so the attachments etc are contained within the one file. How can you change the default SaveAs command to Save as Type in a *.msg format (rather than *.html) so the type is already *.msg without having to use the pull down? Thank you Troy It would be nice to know what mail client you talk about :) "TroyB" <boeky72@hotmail.com> wrote in message news:420b0849$0$1496$5a62ac22@per-qv1-newsreader-01.iinet.net.au... > Hi!, > I regularly need to save emails and prefer to save as *.msg so the > attachme...

highliting works on with html format?
Hi guys, Here is what I would like to do: In outlook, suppose I get a message in plan text format. I would like to open the email, and maybe make some sentences bold and colored. and then I can save it. Hence after sometime the email will be noticable for me. Now, I can do this if the e-mail is sent in html format cause then I open the message and then I press "edit message" and the edit toolbar becomes usable and I do things on the email. However, if the email is sent in "plain text" format, I can not edit the email at all. I try to push the "edit message" butt...

Conversion from CString to std::string
Hi Can anyone post some example code on how to convert from CString to std::string Thanks in advanc Moiz "Moiz Mehmood" <anonymous@discussions.microsoft.com> wrote in message news:BE4F7F9E-CF4F-4BD2-9B17-E40E2F8D156D@microsoft.com... > > Hi, > Can anyone post some example code on how to convert from CString to std::string? > > Thanks in advance > Moiz Hi #include <string> using namespace std; void Convert() { std:string stlstring; CString Foo = "Foo"; // std::string to CString stlstring = Foo; Foo = stlstring.c_st...

can you find specific text in a string ignoring any other text
I'm trying to produce a form which uses data & text from another sheet. I have not been able to get Excel to find specific text in a string while ignoring any other text contained in the string. e.g. "Payment for goods" Find "payment" but ignore "for goods". Then copy the relevant data I need from other cells. I have only been able to find "payment" if it's the only text in the cell. Any help would be appreciated. On Sun, 18 Sep 2005 13:48:03 -0700, "chriscp" <chriscp@discussions.microsoft.com> wrote: >I'm trying...

Q05 not converted?
http://www.microsoft.com/money/quicken.mspx says: "The Converter wizard for Quicken in the U.S. versions of Microsoft Money 2006 will convert files from Quicken U.S. versions 3-7, Quicken 1998-2004" It's just a matter of weeks before people start asking about converting Q06 to M06--and now the answer has changed?!? In microsoft.public.money, Dick Watson wrote: >http://www.microsoft.com/money/quicken.mspx says: > >"The Converter wizard for Quicken in the U.S. versions of Microsoft Money >2006 will convert files from Quicken U.S. versions 3-7, Quicken 199...

Converting Data from Access97 to 2002
Is there a way to convert Access data from 97 to 2002? Or is it too far a conversion? Thanks. Hi Sawanee, The data shouldn't be a problem at all. Access 2002 can open Access 97 files, and conversion is just a matter of using Tools|Database Utilities|Convert Database. If the database also contains forms, reports, VBA modules etc. the conversion usually works smoothly but there can be complications. If you need to share data between Access 2002 and Access 97, split the database in Access 97 so that all the tables are in the back end file. Leave this in Access 97 format. On the Access...

How do I convert microsoft office into .ics format
How do I convert microsoft office into .ics format? I undertand how to export, but I need to import my data into another program that uses the .ics format (inbox.com) Henry;112372 Wrote: > How do I convert microsoft office into .ics format? I undertand how to > export, but I need to import my data into another program that uses the > .ics > format (inbox.com) Microsoft Office is a whole suite of applications: Outlook, Word, Excel, PowerPoint, Visio, Project, and Access. How would you propose converting applications into text files? -- Brian Tillman [M...

Outlook 2000: Printers Dimmed/Greyed Out in "Memo" (or Default Printer Printing) for HTML Messages
Quite a puzzle. Searched lots, no answers. So I thought I'd access the accummulated wisdom of this group. :-) Outlook 2000, Windows XP, any printer local or network. A recent problem, post SP2 update (which went without a hitch). Note: When I refer to the "Outlook Print icon" I mean the one on the top menu of Outlook. When I refer to the "Message Print icon" I mean the one that appears on the top menu of the message window. Normally, I would click on the Outlook Print icon to print an e-mail and it prints to the default printer. If the message is not Plain text, it b...

HTML text gets cut
Hi, one client (w2k, Office2000, IE6SP1, plus patches) has a problem with mails in HTML-format: the text gets cut off after aproximately 1 page and the rest of the text is lost. Mails in plain text or rich text-format is ok. Any help? ...

HTML messages #3
When I use Outlook 2000 to send an HTML message, I often want to cut and paste from other documents. The trouble is, the font and color come with the paste. If I was using Word as my editor, I could use the paintbrush to get this pasted text to the font I was using. Without using Word, how do I clean up my pasted attributes? In microsoft.public.office.misc Howard Brazee <howard@brazee.net> wrote: > When I use Outlook 2000 to send an HTML message, I often want to cut and paste > from other documents. The trouble is, the font and color come with the paste. > If I was us...

why can't print out the HTML format emails ?
Dear All, One of my company's workstation can't print out the HTML format emails ... But it can print out Text and RTF formats emails .... Is there have any problems of this workstation ? How can I fixed it ? Thanks so much ! Sam Mok Answered your original post. -- Robert Sparnaaij [MVP-Outlook] www.howto-outlook.com Tips of the month: -FREE tool; QuickMail. Create new Outlook items anywhere from within Windows -Properly back-up and restore your Outlook data ----- "Sam Mok" <sam_ys@163.net> wrote in message news:OOSQ6eTSFHA.3144@tk2msftngp13.phx.gbl... > ...

variable in string surrounded by underscore
Why does this produce "_" instead of "_1_" PS D:\ts\ts5_2_2> $s = 1 PS D:\ts\ts5_2_2> "_$s_" _ Contrast to $s = 1 "_$($s)_" or $s_ = 1 "_$($s_)_" Underscore is a character allowed in a variable name. - Larry On 4/5/2010 1:08 PM, Dan Holmes wrote: > Why does this produce "_" instead of "_1_" > > PS D:\ts\ts5_2_2> $s = 1 > PS D:\ts\ts5_2_2> "_$s_" > _ Am 05.04.2010 20:08, schrieb Dan Holmes: > Why does this produce "_" instead ...

How to change &amp; to & in string?
All, I receive an xml doc with an element which contains a &amp; in the data. I am attempting to insert the data into a SQL Server database and I want to convert the &amp; to a "&" character before I perform the insert. Is the a way in VB.NET to perform this? -Rich Rich Wallace wrote: > I receive an xml doc with an element which contains a &amp; in the data. I > am attempting to insert the data into a SQL Server database and I want to > convert the &amp; to a "&" character before I perform the insert. Is the a > way in VB.NET to...

searching for text strings inside access databases without opening
Does anyone know if it is possible to earch for text strings inside Access databases without opening them all. I have many backup copies, but have got them out of synch and want to be able to find certain text strings. Try the search function in Windows. Click on the Desktop, click MyComputer, click on your drive, and enter string to search. Vista asks if you want to search within the files. -- Build a little, test a little. "efandango" wrote: > Does anyone know if it is possible to earch for text strings inside Access > databases without opening...

Hyperlinks in HTML email
If I build an HTML email with links that specify the same target, when users click on a link from within Outlook, it launches a new separate IE window each time. If I save the email as HTML and run it, every link will pop in the same window, which is what I want to happen. Is there something to force Outlook to recognize the TARGET attribute? Thanks ...