my $tag = Win32::OLE::Variant->new( VT_R8, $self->{message}->GetIDsFromNames( '{00020386-0000-0000-C000-000000000046}', $name )); # converting the numeric value to binary and back to decimal my $pt_string8 = unpack( "B*", pack( "N", 0x0000001E ) ); my $tag_bin = unpack( "B*", pack( "N", $tag->Value() ) ); my $test = $tag_bin | $pt_string8; $self->{message}->Fields->Put( oct("0b$test"), $value);